using Tessitura.Service.Contract;
using System;
using System.Collections.Generic;
using Tessitura.Service;
using System.Threading.Tasks;
using System.Net.Http;

namespace Tessitura.Service.Facade
{

 
    public class Admin
    {
        private IRestClient restClient;
        public UpgradeLogsFacade UpgradeLogs {get; private set;}

        public Admin(IRestClient restClient)
        {
            this.restClient = restClient;
            UpgradeLogs = new UpgradeLogsFacade(restClient);
        }
    }
 

 
    public class AdminBatch
    {
        private IRestClient restClient;
        public UpgradeLogsFacadeBatch UpgradeLogs {get; private set;}

        public AdminBatch(IRestClient restClient)
        {
            this.restClient = restClient;
            UpgradeLogs = new UpgradeLogsFacadeBatch(restClient);
        }
    }
 

 
    public class BatchFacade
    {
        private IRestClient restClient;
        private BatchRequest batchRequest;
        private Dictionary<int, Type> returnTypeByRequestId;
        public AdminBatch Admin {get; private set;}
        public CrmBatch Crm {get; private set;}
        public CustomFacadeBatch CustomFacade {get; private set;}
        public DiagnosticsFacadeBatch DiagnosticsFacade {get; private set;}
        public EmailsFacadeBatch EmailsFacade {get; private set;}
        public EventsmanagementBatch Eventsmanagement {get; private set;}
        public FinanceBatch Finance {get; private set;}
        public PaymentgatewayBatch Paymentgateway {get; private set;}
        public ReferencedataBatch Referencedata {get; private set;}
        public ReportingBatch Reporting {get; private set;}
        public SecurityBatch Security {get; private set;}
        public TemplatesFacadeBatch TemplatesFacade {get; private set;}
        public TxnBatch Txn {get; private set;}
        public WebBatch Web {get; private set;}

        public BatchFacade(IRestClient restClient)
        {
            this.restClient = restClient;
            batchRequest = new BatchRequest();
            batchRequest = new BatchRequest {Requests = new List<Request>()};
            returnTypeByRequestId = new Dictionary<int, Type>();
            Admin = new AdminBatch(restClient);
            Crm = new CrmBatch(restClient);
            CustomFacade = new CustomFacadeBatch(restClient);
            DiagnosticsFacade = new DiagnosticsFacadeBatch(restClient);
            EmailsFacade = new EmailsFacadeBatch(restClient);
            Eventsmanagement = new EventsmanagementBatch(restClient);
            Finance = new FinanceBatch(restClient);
            Paymentgateway = new PaymentgatewayBatch(restClient);
            Referencedata = new ReferencedataBatch(restClient);
            Reporting = new ReportingBatch(restClient);
            Security = new SecurityBatch(restClient);
            TemplatesFacade = new TemplatesFacadeBatch(restClient);
            Txn = new TxnBatch(restClient);
            Web = new WebBatch(restClient);
        }

        public BatchFacade With(Request request)
        {
             request.Id = batchRequest.Requests.Count + 1;
             returnTypeByRequestId.Add(request.Id, Type.GetType(request.ReturnTypeString));
             batchRequest.Requests.Add(request);
             return this;
        }

        public async Task<BatchResponse> Call()
        {
             var returnObj = await restClient.AtUrl("Batch").PostBatch<BatchRequest, BatchResponse>(batchRequest, returnTypeByRequestId);
             batchRequest = new BatchRequest {Requests = new List<Request>()};
             returnTypeByRequestId = new Dictionary<int, Type>();
             return returnObj;
        }
    }
 

 
    public class Crm
    {
        private IRestClient restClient;
        public ConstituentContributionsFacade ConstituentContributions {get; private set;}
        public MembershipsFacade Memberships {get; private set;}
        public PackageHistoryFacade PackageHistory {get; private set;}
        public TicketHistoryFacade TicketHistory {get; private set;}
        public AccountsFacade Accounts {get; private set;}
        public AddressesFacade Addresses {get; private set;}
        public AffiliationInfoFacade AffiliationInfo {get; private set;}
        public AffiliationsFacade Affiliations {get; private set;}
        public AliasesFacade Aliases {get; private set;}
        public AssociationsFacade Associations {get; private set;}
        public AttributesFacade Attributes {get; private set;}
        public ConstituenciesFacade Constituencies {get; private set;}
        public ConstituentsFacade Constituents {get; private set;}
        public ContactPointPurposeMapsFacade ContactPointPurposeMaps {get; private set;}
        public ContactPointsFacade ContactPoints {get; private set;}
        public ElectronicAddressesFacade ElectronicAddresses {get; private set;}
        public InterestsFacade Interests {get; private set;}
        public InternalFacade Internal {get; private set;}
        public ActionsFacade Actions {get; private set;}
        public IssuesFacade Issues {get; private set;}
        public PhonesFacade Phones {get; private set;}
        public ProgramListingsFacade ProgramListings {get; private set;}
        public RankingsFacade Rankings {get; private set;}
        public RelationshipsFacade Relationships {get; private set;}
        public SalutationsFacade Salutations {get; private set;}
        public WebLoginsFacade WebLogins {get; private set;}
        public SpecialActivitiesFacade SpecialActivities {get; private set;}
        public GiftAidDeclarationsFacade GiftAidDeclarations {get; private set;}
        public WorkerQualificationsFacade WorkerQualifications {get; private set;}
        public ContactPermissionsFacade ContactPermissions {get; private set;}
        public AttendanceHistoryFacade AttendanceHistory {get; private set;}

        public Crm(IRestClient restClient)
        {
            this.restClient = restClient;
            ConstituentContributions = new ConstituentContributionsFacade(restClient);
            Memberships = new MembershipsFacade(restClient);
            PackageHistory = new PackageHistoryFacade(restClient);
            TicketHistory = new TicketHistoryFacade(restClient);
            Accounts = new AccountsFacade(restClient);
            Addresses = new AddressesFacade(restClient);
            AffiliationInfo = new AffiliationInfoFacade(restClient);
            Affiliations = new AffiliationsFacade(restClient);
            Aliases = new AliasesFacade(restClient);
            Associations = new AssociationsFacade(restClient);
            Attributes = new AttributesFacade(restClient);
            Constituencies = new ConstituenciesFacade(restClient);
            Constituents = new ConstituentsFacade(restClient);
            ContactPointPurposeMaps = new ContactPointPurposeMapsFacade(restClient);
            ContactPoints = new ContactPointsFacade(restClient);
            ElectronicAddresses = new ElectronicAddressesFacade(restClient);
            Interests = new InterestsFacade(restClient);
            Internal = new InternalFacade(restClient);
            Actions = new ActionsFacade(restClient);
            Issues = new IssuesFacade(restClient);
            Phones = new PhonesFacade(restClient);
            ProgramListings = new ProgramListingsFacade(restClient);
            Rankings = new RankingsFacade(restClient);
            Relationships = new RelationshipsFacade(restClient);
            Salutations = new SalutationsFacade(restClient);
            WebLogins = new WebLoginsFacade(restClient);
            SpecialActivities = new SpecialActivitiesFacade(restClient);
            GiftAidDeclarations = new GiftAidDeclarationsFacade(restClient);
            WorkerQualifications = new WorkerQualificationsFacade(restClient);
            ContactPermissions = new ContactPermissionsFacade(restClient);
            AttendanceHistory = new AttendanceHistoryFacade(restClient);
        }
    }
 

 
    public class CrmBatch
    {
        private IRestClient restClient;
        public ConstituentContributionsFacadeBatch ConstituentContributions {get; private set;}
        public MembershipsFacadeBatch Memberships {get; private set;}
        public PackageHistoryFacadeBatch PackageHistory {get; private set;}
        public TicketHistoryFacadeBatch TicketHistory {get; private set;}
        public AccountsFacadeBatch Accounts {get; private set;}
        public AddressesFacadeBatch Addresses {get; private set;}
        public AffiliationInfoFacadeBatch AffiliationInfo {get; private set;}
        public AffiliationsFacadeBatch Affiliations {get; private set;}
        public AliasesFacadeBatch Aliases {get; private set;}
        public AssociationsFacadeBatch Associations {get; private set;}
        public AttributesFacadeBatch Attributes {get; private set;}
        public ConstituenciesFacadeBatch Constituencies {get; private set;}
        public ConstituentsFacadeBatch Constituents {get; private set;}
        public ContactPointPurposeMapsFacadeBatch ContactPointPurposeMaps {get; private set;}
        public ContactPointsFacadeBatch ContactPoints {get; private set;}
        public ElectronicAddressesFacadeBatch ElectronicAddresses {get; private set;}
        public InterestsFacadeBatch Interests {get; private set;}
        public InternalFacadeBatch Internal {get; private set;}
        public ActionsFacadeBatch Actions {get; private set;}
        public IssuesFacadeBatch Issues {get; private set;}
        public PhonesFacadeBatch Phones {get; private set;}
        public ProgramListingsFacadeBatch ProgramListings {get; private set;}
        public RankingsFacadeBatch Rankings {get; private set;}
        public RelationshipsFacadeBatch Relationships {get; private set;}
        public SalutationsFacadeBatch Salutations {get; private set;}
        public WebLoginsFacadeBatch WebLogins {get; private set;}
        public SpecialActivitiesFacadeBatch SpecialActivities {get; private set;}
        public GiftAidDeclarationsFacadeBatch GiftAidDeclarations {get; private set;}
        public WorkerQualificationsFacadeBatch WorkerQualifications {get; private set;}
        public ContactPermissionsFacadeBatch ContactPermissions {get; private set;}
        public AttendanceHistoryFacadeBatch AttendanceHistory {get; private set;}

        public CrmBatch(IRestClient restClient)
        {
            this.restClient = restClient;
            ConstituentContributions = new ConstituentContributionsFacadeBatch(restClient);
            Memberships = new MembershipsFacadeBatch(restClient);
            PackageHistory = new PackageHistoryFacadeBatch(restClient);
            TicketHistory = new TicketHistoryFacadeBatch(restClient);
            Accounts = new AccountsFacadeBatch(restClient);
            Addresses = new AddressesFacadeBatch(restClient);
            AffiliationInfo = new AffiliationInfoFacadeBatch(restClient);
            Affiliations = new AffiliationsFacadeBatch(restClient);
            Aliases = new AliasesFacadeBatch(restClient);
            Associations = new AssociationsFacadeBatch(restClient);
            Attributes = new AttributesFacadeBatch(restClient);
            Constituencies = new ConstituenciesFacadeBatch(restClient);
            Constituents = new ConstituentsFacadeBatch(restClient);
            ContactPointPurposeMaps = new ContactPointPurposeMapsFacadeBatch(restClient);
            ContactPoints = new ContactPointsFacadeBatch(restClient);
            ElectronicAddresses = new ElectronicAddressesFacadeBatch(restClient);
            Interests = new InterestsFacadeBatch(restClient);
            Internal = new InternalFacadeBatch(restClient);
            Actions = new ActionsFacadeBatch(restClient);
            Issues = new IssuesFacadeBatch(restClient);
            Phones = new PhonesFacadeBatch(restClient);
            ProgramListings = new ProgramListingsFacadeBatch(restClient);
            Rankings = new RankingsFacadeBatch(restClient);
            Relationships = new RelationshipsFacadeBatch(restClient);
            Salutations = new SalutationsFacadeBatch(restClient);
            WebLogins = new WebLoginsFacadeBatch(restClient);
            SpecialActivities = new SpecialActivitiesFacadeBatch(restClient);
            GiftAidDeclarations = new GiftAidDeclarationsFacadeBatch(restClient);
            WorkerQualifications = new WorkerQualificationsFacadeBatch(restClient);
            ContactPermissions = new ContactPermissionsFacadeBatch(restClient);
            AttendanceHistory = new AttendanceHistoryFacadeBatch(restClient);
        }
    }
 

 
    /// 
    public class CustomFacade
    {
        private IRestClient restClient;

        public CustomFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all data for the resource configured in TR_DATASERVICE_TABLES. The {resourceName} in the URL should be replaced by the name of the resource as configured in TR_DATASERVICE_TABLES. The data can be filtered by using a set of query parameters. The format for the filter query parameters is ?column1=value1&amp;column2=value2, where column1 can either be the name of the column in the table or a formatted name for the column as defined in TR_DATASERVICE_COLUMNS.
        /// </summary>
        /// <param name="resourceName"></param>
        /// <returns></returns>
        public async Task<RestResponse<string>> GetAll(string resourceName = "")
        {
             var urlTemplate = "Custom/{0}";
             urlTemplate = string.Format(urlTemplate, resourceName);
            return await restClient.AtUrl(urlTemplate).Get<string>();
        }

        /// <summary>
        /// Get details of an entry in the table for the resource as defined by {resourceName} in TR_DATASERVICE_TABLES with the given id {Id}.
        /// </summary>
        /// <param name="resourceName"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<string>> Get(string resourceName, string id)
        {
             var urlTemplate = "Custom/{0}/{1}";
             urlTemplate = string.Format(urlTemplate, resourceName, id);
            return await restClient.AtUrl(urlTemplate).Get<string>();
        }

        /// 
        public async Task<RestResponse<string>> GetMetadata()
        {
            return await restClient.AtUrl("Custom/Metadata").Get<string>();
        }

        /// <summary>
        /// Update the details of an entry in the table for the resource as defined by {resourceName} in TR_DATASERVICE_TABLES with the given id {Id}.
        /// </summary>
        /// <param name="resourceName"></param>
        /// <param name="id"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<string>> Update(string resourceName, string id, string request)
        {
             var urlTemplate = "Custom/{0}/{1}";
             urlTemplate = string.Format(urlTemplate, resourceName, id);
            return await restClient.AtUrl(urlTemplate).Put<string, string>(request);
        }

        /// <summary>
        /// Create an entry with the given data for the table as defined by the {resourceName} in TR_DATASERVICE_TABLES.
        /// </summary>
        /// <param name="resourceName"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<string>> Create(string resourceName, string request)
        {
             var urlTemplate = "Custom/{0}";
             urlTemplate = string.Format(urlTemplate, resourceName);
            return await restClient.AtUrl(urlTemplate).Post<string, string>(request);
        }

        /// <summary>
        /// Executes a local procedure defined in TR_LOCAL_PROCEDURE. The parameter values that contain &amp; or = should be escaped with a backslash(\\) in front of it.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<string>> ExecuteLocalProcedure(string request)
        {
            return await restClient.AtUrl("Custom/Execute").Post<string, string>(request);
        }

        /// <summary>
        /// Delete an entry from the table for the resource as defined by {resourceName} in TR_DATASERVICE_TABLES with the given id {Id}.
        /// </summary>
        /// <param name="resourceName"></param>
        /// <param name="id"></param>
        public async Task<RestResponse<NoResponse>> Delete(string resourceName, string id)
        {
             var urlTemplate = "Custom/{0}/{1}";
             urlTemplate = string.Format(urlTemplate, resourceName, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class CustomFacadeBatch
    {
        private IRestClient restClient;

        public CustomFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all data for the resource configured in TR_DATASERVICE_TABLES. The {resourceName} in the URL should be replaced by the name of the resource as configured in TR_DATASERVICE_TABLES. The data can be filtered by using a set of query parameters. The format for the filter query parameters is ?column1=value1&amp;column2=value2, where column1 can either be the name of the column in the table or a formatted name for the column as defined in TR_DATASERVICE_COLUMNS.
        /// </summary>
        /// <param name="resourceName"></param>
        /// <returns></returns>
        public Request GetAll(string resourceName = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.string";
            bRequest.Content = null;

            var urlTemplate = "Custom/{0}";
            urlTemplate = string.Format(urlTemplate, resourceName);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of an entry in the table for the resource as defined by {resourceName} in TR_DATASERVICE_TABLES with the given id {Id}.
        /// </summary>
        /// <param name="resourceName"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string resourceName, string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.string";
            bRequest.Content = null;

            var urlTemplate = "Custom/{0}/{1}";
            urlTemplate = string.Format(urlTemplate, resourceName, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetMetadata(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.string";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "Custom/Metadata";

            return bRequest;
        }

        /// <summary>
        /// Update the details of an entry in the table for the resource as defined by {resourceName} in TR_DATASERVICE_TABLES with the given id {Id}.
        /// </summary>
        /// <param name="resourceName"></param>
        /// <param name="id"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request Update(string resourceName, string id, string request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.string";
            bRequest.Content = request;

            var urlTemplate = "Custom/{0}/{1}";
            urlTemplate = string.Format(urlTemplate, resourceName, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create an entry with the given data for the table as defined by the {resourceName} in TR_DATASERVICE_TABLES.
        /// </summary>
        /// <param name="resourceName"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request Create(string resourceName, string request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.string";
            bRequest.Content = request;

            var urlTemplate = "Custom/{0}";
            urlTemplate = string.Format(urlTemplate, resourceName);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Executes a local procedure defined in TR_LOCAL_PROCEDURE. The parameter values that contain &amp; or = should be escaped with a backslash(\\) in front of it.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request ExecuteLocalProcedure(string request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.string";
            bRequest.Content = request;

            bRequest.Uri = restClient.GetBaseUrl() + "Custom/Execute";

            return bRequest;
        }

        /// <summary>
        /// Delete an entry from the table for the resource as defined by {resourceName} in TR_DATASERVICE_TABLES with the given id {Id}.
        /// </summary>
        /// <param name="resourceName"></param>
        /// <param name="id"></param>
        public Request Delete(string resourceName, string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Custom/{0}/{1}";
            urlTemplate = string.Format(urlTemplate, resourceName, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class DiagnosticsFacade
    {
        private IRestClient restClient;

        public DiagnosticsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Dummy end point to check availability of HTTP PUT.
        /// </summary>
        /// <param name="diagnosticId"></param>
        /// <param name="diagnostic"></param>
        /// <returns></returns>
        public async Task<RestResponse<Diagnostic>> Put(string diagnosticId, Diagnostic diagnostic)
        {
             var urlTemplate = "Diagnostics/{0}";
             urlTemplate = string.Format(urlTemplate, diagnosticId);
            return await restClient.AtUrl(urlTemplate).Put<Diagnostic, Diagnostic>(diagnostic);
        }

        /// 
        public async Task<RestResponse<EncryptionKeyCheckResponse>> EncryptionKeyCheck()
        {
            return await restClient.AtUrl("Diagnostics/EncryptionKey").Get<EncryptionKeyCheckResponse>();
        }

        /// <summary>
        /// Check connection information.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<DatabaseCheckResponse>> Check(DatabaseCheckRequest request)
        {
            return await restClient.AtUrl("Diagnostics/Check").Post<DatabaseCheckRequest, DatabaseCheckResponse>(request);
        }

        /// <summary>
        /// Dummy end point to check availability of HTTP DELETE.
        /// </summary>
        /// <param name="diagnosticId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string diagnosticId)
        {
             var urlTemplate = "Diagnostics/{0}";
             urlTemplate = string.Format(urlTemplate, diagnosticId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// 
        public async Task<RestResponse<Status>> GetStatus()
        {
            return await restClient.AtUrl("Diagnostics/Status").Get<Status>();
        }

        /// 
        public async Task<RestResponse<SeatServerStatus>> GetSeatServerStatus()
        {
            return await restClient.AtUrl("Diagnostics/SeatServerStatus").Get<SeatServerStatus>();
        }

        /// 
        public async Task<RestResponse<string>> GetStatusReport()
        {
            return await restClient.AtUrl("Diagnostics/Report").Get<string>();
        }

    }
 

 
    /// 
    public class DiagnosticsFacadeBatch
    {
        private IRestClient restClient;

        public DiagnosticsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Dummy end point to check availability of HTTP PUT.
        /// </summary>
        /// <param name="diagnosticId"></param>
        /// <param name="diagnostic"></param>
        /// <returns></returns>
        public Request Put(string diagnosticId, Diagnostic diagnostic, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Diagnostic";
            bRequest.Content = diagnostic;

            var urlTemplate = "Diagnostics/{0}";
            urlTemplate = string.Format(urlTemplate, diagnosticId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request EncryptionKeyCheck(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.EncryptionKeyCheckResponse";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "Diagnostics/EncryptionKey";

            return bRequest;
        }

        /// <summary>
        /// Check connection information.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request Check(DatabaseCheckRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DatabaseCheckResponse";
            bRequest.Content = request;

            bRequest.Uri = restClient.GetBaseUrl() + "Diagnostics/Check";

            return bRequest;
        }

        /// <summary>
        /// Dummy end point to check availability of HTTP DELETE.
        /// </summary>
        /// <param name="diagnosticId"></param>
        public Request Delete(string diagnosticId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Diagnostics/{0}";
            urlTemplate = string.Format(urlTemplate, diagnosticId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetStatus(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Status";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "Diagnostics/Status";

            return bRequest;
        }

        /// 
        public Request GetSeatServerStatus(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SeatServerStatus";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "Diagnostics/SeatServerStatus";

            return bRequest;
        }

        /// 
        public Request GetStatusReport(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.string";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "Diagnostics/Report";

            return bRequest;
        }

    }
 

 
    /// 
    public class EmailsFacade
    {
        private IRestClient restClient;

        public EmailsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Queues an email for send using given values.
        /// </summary>
        /// <param name="request"></param>
        public async Task<RestResponse<NoResponse>> Send(EmailSendRequest request)
        {
            return await restClient.AtUrl("Emails/Send").Post<EmailSendRequest, NoResponse>(request);
        }

        /// <summary>
        /// Sends an Order Confirmation email
        /// </summary>
        /// <param name="orderId"></param>
        /// <param name="request"></param>
        public async Task<RestResponse<NoResponse>> SendOrderConfirmation(string orderId, SendTemplateEmailRequest request)
        {
             var urlTemplate = "Emails/OrderConfirmation/{0}/Send";
             urlTemplate = string.Format(urlTemplate, orderId);
            return await restClient.AtUrl(urlTemplate).Post<SendTemplateEmailRequest, NoResponse>(request);
        }

        /// <summary>
        /// Sends a Login Credentials email
        /// </summary>
        /// <param name="loginId"></param>
        /// <param name="request"></param>
        public async Task<RestResponse<NoResponse>> SendLoginCredentials(string loginId, SendTemplateEmailRequest request)
        {
             var urlTemplate = "Emails/LoginCredentials/{0}/Send";
             urlTemplate = string.Format(urlTemplate, loginId);
            return await restClient.AtUrl(urlTemplate).Post<SendTemplateEmailRequest, NoResponse>(request);
        }

    }
 

 
    /// 
    public class EmailsFacadeBatch
    {
        private IRestClient restClient;

        public EmailsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Queues an email for send using given values.
        /// </summary>
        /// <param name="request"></param>
        public Request Send(EmailSendRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = request;

            bRequest.Uri = restClient.GetBaseUrl() + "Emails/Send";

            return bRequest;
        }

        /// <summary>
        /// Sends an Order Confirmation email
        /// </summary>
        /// <param name="orderId"></param>
        /// <param name="request"></param>
        public Request SendOrderConfirmation(string orderId, SendTemplateEmailRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = request;

            var urlTemplate = "Emails/OrderConfirmation/{0}/Send";
            urlTemplate = string.Format(urlTemplate, orderId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Sends a Login Credentials email
        /// </summary>
        /// <param name="loginId"></param>
        /// <param name="request"></param>
        public Request SendLoginCredentials(string loginId, SendTemplateEmailRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = request;

            var urlTemplate = "Emails/LoginCredentials/{0}/Send";
            urlTemplate = string.Format(urlTemplate, loginId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    public class Eventsmanagement
    {
        private IRestClient restClient;
        public BookingTemplatesFacade BookingTemplates {get; private set;}
        public ResourceTypesFacade ResourceTypes {get; private set;}
        public ResourcesFacade Resources {get; private set;}
        public BookingsFacade Bookings {get; private set;}
        public ResourceSchedulesFacade ResourceSchedules {get; private set;}

        public Eventsmanagement(IRestClient restClient)
        {
            this.restClient = restClient;
            BookingTemplates = new BookingTemplatesFacade(restClient);
            ResourceTypes = new ResourceTypesFacade(restClient);
            Resources = new ResourcesFacade(restClient);
            Bookings = new BookingsFacade(restClient);
            ResourceSchedules = new ResourceSchedulesFacade(restClient);
        }
    }
 

 
    public class EventsmanagementBatch
    {
        private IRestClient restClient;
        public BookingTemplatesFacadeBatch BookingTemplates {get; private set;}
        public ResourceTypesFacadeBatch ResourceTypes {get; private set;}
        public ResourcesFacadeBatch Resources {get; private set;}
        public BookingsFacadeBatch Bookings {get; private set;}
        public ResourceSchedulesFacadeBatch ResourceSchedules {get; private set;}

        public EventsmanagementBatch(IRestClient restClient)
        {
            this.restClient = restClient;
            BookingTemplates = new BookingTemplatesFacadeBatch(restClient);
            ResourceTypes = new ResourceTypesFacadeBatch(restClient);
            Resources = new ResourcesFacadeBatch(restClient);
            Bookings = new BookingsFacadeBatch(restClient);
            ResourceSchedules = new ResourceSchedulesFacadeBatch(restClient);
        }
    }
 

 
    public class Finance
    {
        private IRestClient restClient;
        public GiftCertificatesFacade GiftCertificates {get; private set;}
        public AppealsFacade Appeals {get; private set;}
        public CampaignDesignationsFacade CampaignDesignations {get; private set;}
        public CampaignFundsFacade CampaignFunds {get; private set;}
        public CampaignsFacade Campaigns {get; private set;}
        public ContributionsFacade Contributions {get; private set;}
        public DocumentsFacade Documents {get; private set;}
        public FundsFacade Funds {get; private set;}
        public ListContentsFacade ListContents {get; private set;}
        public ListsFacade Lists {get; private set;}
        public MembershipLevelsFacade MembershipLevels {get; private set;}
        public MembershipOrganizationsFacade MembershipOrganizations {get; private set;}
        public PlansFacade Plans {get; private set;}
        public PlanWorkersFacade PlanWorkers {get; private set;}
        public PortfoliosFacade Portfolios {get; private set;}
        public SourcesFacade Sources {get; private set;}
        public StepsFacade Steps {get; private set;}
        public WorkersFacade Workers {get; private set;}
        public BatchMaintenanceFacade BatchMaintenance {get; private set;}
        public BatchTypeUserGroupFacade BatchTypeUserGroup {get; private set;}

        public Finance(IRestClient restClient)
        {
            this.restClient = restClient;
            GiftCertificates = new GiftCertificatesFacade(restClient);
            Appeals = new AppealsFacade(restClient);
            CampaignDesignations = new CampaignDesignationsFacade(restClient);
            CampaignFunds = new CampaignFundsFacade(restClient);
            Campaigns = new CampaignsFacade(restClient);
            Contributions = new ContributionsFacade(restClient);
            Documents = new DocumentsFacade(restClient);
            Funds = new FundsFacade(restClient);
            ListContents = new ListContentsFacade(restClient);
            Lists = new ListsFacade(restClient);
            MembershipLevels = new MembershipLevelsFacade(restClient);
            MembershipOrganizations = new MembershipOrganizationsFacade(restClient);
            Plans = new PlansFacade(restClient);
            PlanWorkers = new PlanWorkersFacade(restClient);
            Portfolios = new PortfoliosFacade(restClient);
            Sources = new SourcesFacade(restClient);
            Steps = new StepsFacade(restClient);
            Workers = new WorkersFacade(restClient);
            BatchMaintenance = new BatchMaintenanceFacade(restClient);
            BatchTypeUserGroup = new BatchTypeUserGroupFacade(restClient);
        }
    }
 

 
    public class FinanceBatch
    {
        private IRestClient restClient;
        public GiftCertificatesFacadeBatch GiftCertificates {get; private set;}
        public AppealsFacadeBatch Appeals {get; private set;}
        public CampaignDesignationsFacadeBatch CampaignDesignations {get; private set;}
        public CampaignFundsFacadeBatch CampaignFunds {get; private set;}
        public CampaignsFacadeBatch Campaigns {get; private set;}
        public ContributionsFacadeBatch Contributions {get; private set;}
        public DocumentsFacadeBatch Documents {get; private set;}
        public FundsFacadeBatch Funds {get; private set;}
        public ListContentsFacadeBatch ListContents {get; private set;}
        public ListsFacadeBatch Lists {get; private set;}
        public MembershipLevelsFacadeBatch MembershipLevels {get; private set;}
        public MembershipOrganizationsFacadeBatch MembershipOrganizations {get; private set;}
        public PlansFacadeBatch Plans {get; private set;}
        public PlanWorkersFacadeBatch PlanWorkers {get; private set;}
        public PortfoliosFacadeBatch Portfolios {get; private set;}
        public SourcesFacadeBatch Sources {get; private set;}
        public StepsFacadeBatch Steps {get; private set;}
        public WorkersFacadeBatch Workers {get; private set;}
        public BatchMaintenanceFacadeBatch BatchMaintenance {get; private set;}
        public BatchTypeUserGroupFacadeBatch BatchTypeUserGroup {get; private set;}

        public FinanceBatch(IRestClient restClient)
        {
            this.restClient = restClient;
            GiftCertificates = new GiftCertificatesFacadeBatch(restClient);
            Appeals = new AppealsFacadeBatch(restClient);
            CampaignDesignations = new CampaignDesignationsFacadeBatch(restClient);
            CampaignFunds = new CampaignFundsFacadeBatch(restClient);
            Campaigns = new CampaignsFacadeBatch(restClient);
            Contributions = new ContributionsFacadeBatch(restClient);
            Documents = new DocumentsFacadeBatch(restClient);
            Funds = new FundsFacadeBatch(restClient);
            ListContents = new ListContentsFacadeBatch(restClient);
            Lists = new ListsFacadeBatch(restClient);
            MembershipLevels = new MembershipLevelsFacadeBatch(restClient);
            MembershipOrganizations = new MembershipOrganizationsFacadeBatch(restClient);
            Plans = new PlansFacadeBatch(restClient);
            PlanWorkers = new PlanWorkersFacadeBatch(restClient);
            Portfolios = new PortfoliosFacadeBatch(restClient);
            Sources = new SourcesFacadeBatch(restClient);
            Steps = new StepsFacadeBatch(restClient);
            Workers = new WorkersFacadeBatch(restClient);
            BatchMaintenance = new BatchMaintenanceFacadeBatch(restClient);
            BatchTypeUserGroup = new BatchTypeUserGroupFacadeBatch(restClient);
        }
    }
 

 
    public class Paymentgateway
    {
        private IRestClient restClient;
        public PaymentGatewayAccountsFacade PaymentGatewayAccounts {get; private set;}
        public AuthorizationFacade Authorization {get; private set;}
        public ConfigurationFacade Configuration {get; private set;}
        public PaymentGatewayActivitiesFacade PaymentGatewayActivities {get; private set;}

        public Paymentgateway(IRestClient restClient)
        {
            this.restClient = restClient;
            PaymentGatewayAccounts = new PaymentGatewayAccountsFacade(restClient);
            Authorization = new AuthorizationFacade(restClient);
            Configuration = new ConfigurationFacade(restClient);
            PaymentGatewayActivities = new PaymentGatewayActivitiesFacade(restClient);
        }
    }
 

 
    public class PaymentgatewayBatch
    {
        private IRestClient restClient;
        public PaymentGatewayAccountsFacadeBatch PaymentGatewayAccounts {get; private set;}
        public AuthorizationFacadeBatch Authorization {get; private set;}
        public ConfigurationFacadeBatch Configuration {get; private set;}
        public PaymentGatewayActivitiesFacadeBatch PaymentGatewayActivities {get; private set;}

        public PaymentgatewayBatch(IRestClient restClient)
        {
            this.restClient = restClient;
            PaymentGatewayAccounts = new PaymentGatewayAccountsFacadeBatch(restClient);
            Authorization = new AuthorizationFacadeBatch(restClient);
            Configuration = new ConfigurationFacadeBatch(restClient);
            PaymentGatewayActivities = new PaymentGatewayActivitiesFacadeBatch(restClient);
        }
    }
 

 
    public class Referencedata
    {
        private IRestClient restClient;
        public TemplateTypesFacade TemplateTypes {get; private set;}
        public AccountTypesFacade AccountTypes {get; private set;}
        public FormatsFacade Formats {get; private set;}
        public ListCategoriesFacade ListCategories {get; private set;}
        public PriceTypeReasonsFacade PriceTypeReasons {get; private set;}
        public ActionTypesFacade ActionTypes {get; private set;}
        public ActivityCategoriesFacade ActivityCategories {get; private set;}
        public ActivityTypesFacade ActivityTypes {get; private set;}
        public AddressTypesFacade AddressTypes {get; private set;}
        public AffiliationTypesFacade AffiliationTypes {get; private set;}
        public AliasTypesFacade AliasTypes {get; private set;}
        public AppealCategoriesFacade AppealCategories {get; private set;}
        public AssetTypesFacade AssetTypes {get; private set;}
        public AssociationTypesFacade AssociationTypes {get; private set;}
        public BatchTypeGroupsFacade BatchTypeGroups {get; private set;}
        public BatchTypesFacade BatchTypes {get; private set;}
        public BusinessUnitsFacade BusinessUnits {get; private set;}
        public ColorsFacade Colors {get; private set;}
        public ComposersFacade Composers {get; private set;}
        public ConstituencyTypesFacade ConstituencyTypes {get; private set;}
        public ConstituentGroupsFacade ConstituentGroups {get; private set;}
        public ConstituentInactivesFacade ConstituentInactives {get; private set;}
        public ConstituentTypeAffiliatesFacade ConstituentTypeAffiliates {get; private set;}
        public ConstituentTypesFacade ConstituentTypes {get; private set;}
        public ContactPointCategoryPurposesFacade ContactPointCategoryPurposes {get; private set;}
        public ContactPointCategoriesFacade ContactPointCategories {get; private set;}
        public ContactPointPurposesFacade ContactPointPurposes {get; private set;}
        public ContactTypesFacade ContactTypes {get; private set;}
        public ContributionDesignationsFacade ContributionDesignations {get; private set;}
        public ControlGroupsFacade ControlGroups {get; private set;}
        public CountriesFacade Countries {get; private set;}
        public CriterionOperatorsFacade CriterionOperators {get; private set;}
        public DeliveryMethodsFacade DeliveryMethods {get; private set;}
        public DesignationCodesFacade DesignationCodes {get; private set;}
        public DesignsFacade Designs {get; private set;}
        public DonationLevelsFacade DonationLevels {get; private set;}
        public ElectronicAddressTypesFacade ElectronicAddressTypes {get; private set;}
        public EmarketIndicatorsFacade EmarketIndicators {get; private set;}
        public ErasFacade Eras {get; private set;}
        public GLAccountsFacade GLAccounts {get; private set;}
        public InactiveReasonsFacade InactiveReasons {get; private set;}
        public InterestCategoriesFacade InterestCategories {get; private set;}
        public InterestTypesFacade InterestTypes {get; private set;}
        public KeywordCategoriesFacade KeywordCategories {get; private set;}
        public KeywordsFacade Keywords {get; private set;}
        public LanguagesFacade Languages {get; private set;}
        public LoginTypesFacade LoginTypes {get; private set;}
        public MailIndicatorsFacade MailIndicators {get; private set;}
        public MediaTypesFacade MediaTypes {get; private set;}
        public MembershipLevelCategoriesFacade MembershipLevelCategories {get; private set;}
        public NameStatusesFacade NameStatuses {get; private set;}
        public OrderCategoriesFacade OrderCategories {get; private set;}
        public OriginalSourcesFacade OriginalSources {get; private set;}
        public OriginsFacade Origins {get; private set;}
        public PackageTypesFacade PackageTypes {get; private set;}
        public PaymentMethodGroupsFacade PaymentMethodGroups {get; private set;}
        public PaymentTypesFacade PaymentTypes {get; private set;}
        public PerformanceStatusesFacade PerformanceStatuses {get; private set;}
        public PerformanceTypesFacade PerformanceTypes {get; private set;}
        public PhoneIndicatorsFacade PhoneIndicators {get; private set;}
        public PhoneTypesFacade PhoneTypes {get; private set;}
        public PlanPrioritiesFacade PlanPriorities {get; private set;}
        public PlanSourcesFacade PlanSources {get; private set;}
        public PlanStatusesFacade PlanStatuses {get; private set;}
        public PlanTypesFacade PlanTypes {get; private set;}
        public PortfolioCustomElementsFacade PortfolioCustomElements {get; private set;}
        public PrefixesFacade Prefixes {get; private set;}
        public PremieresFacade Premieres {get; private set;}
        public PriceCategoriesFacade PriceCategories {get; private set;}
        public PriceLayerTypesFacade PriceLayerTypes {get; private set;}
        public PriceTypeCategoriesFacade PriceTypeCategories {get; private set;}
        public PriceTypeGroupsFacade PriceTypeGroups {get; private set;}
        public PricingRuleCategoriesFacade PricingRuleCategories {get; private set;}
        public PricingRuleMessageTypesFacade PricingRuleMessageTypes {get; private set;}
        public PricingRuleTypesFacade PricingRuleTypes {get; private set;}
        public PrintersFacade Printers {get; private set;}
        public ProgramsFacade Programs {get; private set;}
        public ContactPointPurposeCategoriesFacade ContactPointPurposeCategories {get; private set;}
        public RankTypesFacade RankTypes {get; private set;}
        public ReferenceColumnsFacade ReferenceColumns {get; private set;}
        public ReferenceTablesFacade ReferenceTables {get; private set;}
        public RelationshipCategoriesFacade RelationshipCategories {get; private set;}
        public SalesChannelsFacade SalesChannels {get; private set;}
        public SalesLayoutButtonTypesFacade SalesLayoutButtonTypes {get; private set;}
        public SalutationTypesFacade SalutationTypes {get; private set;}
        public SeasonsFacade Seasons {get; private set;}
        public SeasonTypesFacade SeasonTypes {get; private set;}
        public SeatCodesFacade SeatCodes {get; private set;}
        public SeatStatusesFacade SeatStatuses {get; private set;}
        public SectionsFacade Sections {get; private set;}
        public ServiceResourcesFacade ServiceResources {get; private set;}
        public SourceGroupsFacade SourceGroups {get; private set;}
        public StatesFacade States {get; private set;}
        public StepTypesFacade StepTypes {get; private set;}
        public SubLineItemStatusesFacade SubLineItemStatuses {get; private set;}
        public SuffixesFacade Suffixes {get; private set;}
        public SurveyQuestionsFacade SurveyQuestions {get; private set;}
        public SystemDefaultsFacade SystemDefaults {get; private set;}
        public TheatersFacade Theaters {get; private set;}
        public TimeSlotsFacade TimeSlots {get; private set;}
        public UserGroupsFacade UserGroups {get; private set;}
        public WorkerRolesFacade WorkerRoles {get; private set;}
        public WorkerTypesFacade WorkerTypes {get; private set;}
        public ZoneGroupsFacade ZoneGroups {get; private set;}
        public DiscountTypesFacade DiscountTypes {get; private set;}
        public ReceiptSettingsFacade ReceiptSettings {get; private set;}
        public BillingTypesFacade BillingTypes {get; private set;}
        public BillingSchedulesFacade BillingSchedules {get; private set;}
        public SpecialActivityTypesFacade SpecialActivityTypes {get; private set;}
        public SpecialActivityStatusesFacade SpecialActivityStatuses {get; private set;}
        public HoldCodeCategoriesFacade HoldCodeCategories {get; private set;}
        public UpgradeCategoriesFacade UpgradeCategories {get; private set;}
        public GiftAidTypesFacade GiftAidTypes {get; private set;}
        public GiftAidStatusesFacade GiftAidStatuses {get; private set;}
        public GiftAidRatesFacade GiftAidRates {get; private set;}
        public GiftAidIneligibleReasonsFacade GiftAidIneligibleReasons {get; private set;}
        public GiftAidDocumentStatusesFacade GiftAidDocumentStatuses {get; private set;}
        public GiftAidContactMethodsFacade GiftAidContactMethods {get; private set;}
        public CardReaderTypesFacade CardReaderTypes {get; private set;}
        public MachineSettingsFacade MachineSettings {get; private set;}
        public ResourceCategoriesFacade ResourceCategories {get; private set;}
        public ScheduleTypesFacade ScheduleTypes {get; private set;}
        public SchedulePatternTypesFacade SchedulePatternTypes {get; private set;}
        public QualificationsFacade Qualifications {get; private set;}
        public QualificationCategoriesFacade QualificationCategories {get; private set;}
        public PaymentGatewayTransactionTypesFacade PaymentGatewayTransactionTypes {get; private set;}
        public BookingCategoriesFacade BookingCategories {get; private set;}
        public CurrencyTypesFacade CurrencyTypes {get; private set;}
        public EmailProfilesFacade EmailProfiles {get; private set;}
        public ContactPermissionCategoriesFacade ContactPermissionCategories {get; private set;}
        public ContactPermissionTypesFacade ContactPermissionTypes {get; private set;}
        public NScanAccessAreasFacade NScanAccessAreas {get; private set;}
        public TemplateCategoriesFacade TemplateCategories {get; private set;}
        public OrganizationsFacade Organizations {get; private set;}
        public QueryElementsFacade QueryElements {get; private set;}

        public Referencedata(IRestClient restClient)
        {
            this.restClient = restClient;
            TemplateTypes = new TemplateTypesFacade(restClient);
            AccountTypes = new AccountTypesFacade(restClient);
            Formats = new FormatsFacade(restClient);
            ListCategories = new ListCategoriesFacade(restClient);
            PriceTypeReasons = new PriceTypeReasonsFacade(restClient);
            ActionTypes = new ActionTypesFacade(restClient);
            ActivityCategories = new ActivityCategoriesFacade(restClient);
            ActivityTypes = new ActivityTypesFacade(restClient);
            AddressTypes = new AddressTypesFacade(restClient);
            AffiliationTypes = new AffiliationTypesFacade(restClient);
            AliasTypes = new AliasTypesFacade(restClient);
            AppealCategories = new AppealCategoriesFacade(restClient);
            AssetTypes = new AssetTypesFacade(restClient);
            AssociationTypes = new AssociationTypesFacade(restClient);
            BatchTypeGroups = new BatchTypeGroupsFacade(restClient);
            BatchTypes = new BatchTypesFacade(restClient);
            BusinessUnits = new BusinessUnitsFacade(restClient);
            Colors = new ColorsFacade(restClient);
            Composers = new ComposersFacade(restClient);
            ConstituencyTypes = new ConstituencyTypesFacade(restClient);
            ConstituentGroups = new ConstituentGroupsFacade(restClient);
            ConstituentInactives = new ConstituentInactivesFacade(restClient);
            ConstituentTypeAffiliates = new ConstituentTypeAffiliatesFacade(restClient);
            ConstituentTypes = new ConstituentTypesFacade(restClient);
            ContactPointCategoryPurposes = new ContactPointCategoryPurposesFacade(restClient);
            ContactPointCategories = new ContactPointCategoriesFacade(restClient);
            ContactPointPurposes = new ContactPointPurposesFacade(restClient);
            ContactTypes = new ContactTypesFacade(restClient);
            ContributionDesignations = new ContributionDesignationsFacade(restClient);
            ControlGroups = new ControlGroupsFacade(restClient);
            Countries = new CountriesFacade(restClient);
            CriterionOperators = new CriterionOperatorsFacade(restClient);
            DeliveryMethods = new DeliveryMethodsFacade(restClient);
            DesignationCodes = new DesignationCodesFacade(restClient);
            Designs = new DesignsFacade(restClient);
            DonationLevels = new DonationLevelsFacade(restClient);
            ElectronicAddressTypes = new ElectronicAddressTypesFacade(restClient);
            EmarketIndicators = new EmarketIndicatorsFacade(restClient);
            Eras = new ErasFacade(restClient);
            GLAccounts = new GLAccountsFacade(restClient);
            InactiveReasons = new InactiveReasonsFacade(restClient);
            InterestCategories = new InterestCategoriesFacade(restClient);
            InterestTypes = new InterestTypesFacade(restClient);
            KeywordCategories = new KeywordCategoriesFacade(restClient);
            Keywords = new KeywordsFacade(restClient);
            Languages = new LanguagesFacade(restClient);
            LoginTypes = new LoginTypesFacade(restClient);
            MailIndicators = new MailIndicatorsFacade(restClient);
            MediaTypes = new MediaTypesFacade(restClient);
            MembershipLevelCategories = new MembershipLevelCategoriesFacade(restClient);
            NameStatuses = new NameStatusesFacade(restClient);
            OrderCategories = new OrderCategoriesFacade(restClient);
            OriginalSources = new OriginalSourcesFacade(restClient);
            Origins = new OriginsFacade(restClient);
            PackageTypes = new PackageTypesFacade(restClient);
            PaymentMethodGroups = new PaymentMethodGroupsFacade(restClient);
            PaymentTypes = new PaymentTypesFacade(restClient);
            PerformanceStatuses = new PerformanceStatusesFacade(restClient);
            PerformanceTypes = new PerformanceTypesFacade(restClient);
            PhoneIndicators = new PhoneIndicatorsFacade(restClient);
            PhoneTypes = new PhoneTypesFacade(restClient);
            PlanPriorities = new PlanPrioritiesFacade(restClient);
            PlanSources = new PlanSourcesFacade(restClient);
            PlanStatuses = new PlanStatusesFacade(restClient);
            PlanTypes = new PlanTypesFacade(restClient);
            PortfolioCustomElements = new PortfolioCustomElementsFacade(restClient);
            Prefixes = new PrefixesFacade(restClient);
            Premieres = new PremieresFacade(restClient);
            PriceCategories = new PriceCategoriesFacade(restClient);
            PriceLayerTypes = new PriceLayerTypesFacade(restClient);
            PriceTypeCategories = new PriceTypeCategoriesFacade(restClient);
            PriceTypeGroups = new PriceTypeGroupsFacade(restClient);
            PricingRuleCategories = new PricingRuleCategoriesFacade(restClient);
            PricingRuleMessageTypes = new PricingRuleMessageTypesFacade(restClient);
            PricingRuleTypes = new PricingRuleTypesFacade(restClient);
            Printers = new PrintersFacade(restClient);
            Programs = new ProgramsFacade(restClient);
            ContactPointPurposeCategories = new ContactPointPurposeCategoriesFacade(restClient);
            RankTypes = new RankTypesFacade(restClient);
            ReferenceColumns = new ReferenceColumnsFacade(restClient);
            ReferenceTables = new ReferenceTablesFacade(restClient);
            RelationshipCategories = new RelationshipCategoriesFacade(restClient);
            SalesChannels = new SalesChannelsFacade(restClient);
            SalesLayoutButtonTypes = new SalesLayoutButtonTypesFacade(restClient);
            SalutationTypes = new SalutationTypesFacade(restClient);
            Seasons = new SeasonsFacade(restClient);
            SeasonTypes = new SeasonTypesFacade(restClient);
            SeatCodes = new SeatCodesFacade(restClient);
            SeatStatuses = new SeatStatusesFacade(restClient);
            Sections = new SectionsFacade(restClient);
            ServiceResources = new ServiceResourcesFacade(restClient);
            SourceGroups = new SourceGroupsFacade(restClient);
            States = new StatesFacade(restClient);
            StepTypes = new StepTypesFacade(restClient);
            SubLineItemStatuses = new SubLineItemStatusesFacade(restClient);
            Suffixes = new SuffixesFacade(restClient);
            SurveyQuestions = new SurveyQuestionsFacade(restClient);
            SystemDefaults = new SystemDefaultsFacade(restClient);
            Theaters = new TheatersFacade(restClient);
            TimeSlots = new TimeSlotsFacade(restClient);
            UserGroups = new UserGroupsFacade(restClient);
            WorkerRoles = new WorkerRolesFacade(restClient);
            WorkerTypes = new WorkerTypesFacade(restClient);
            ZoneGroups = new ZoneGroupsFacade(restClient);
            DiscountTypes = new DiscountTypesFacade(restClient);
            ReceiptSettings = new ReceiptSettingsFacade(restClient);
            BillingTypes = new BillingTypesFacade(restClient);
            BillingSchedules = new BillingSchedulesFacade(restClient);
            SpecialActivityTypes = new SpecialActivityTypesFacade(restClient);
            SpecialActivityStatuses = new SpecialActivityStatusesFacade(restClient);
            HoldCodeCategories = new HoldCodeCategoriesFacade(restClient);
            UpgradeCategories = new UpgradeCategoriesFacade(restClient);
            GiftAidTypes = new GiftAidTypesFacade(restClient);
            GiftAidStatuses = new GiftAidStatusesFacade(restClient);
            GiftAidRates = new GiftAidRatesFacade(restClient);
            GiftAidIneligibleReasons = new GiftAidIneligibleReasonsFacade(restClient);
            GiftAidDocumentStatuses = new GiftAidDocumentStatusesFacade(restClient);
            GiftAidContactMethods = new GiftAidContactMethodsFacade(restClient);
            CardReaderTypes = new CardReaderTypesFacade(restClient);
            MachineSettings = new MachineSettingsFacade(restClient);
            ResourceCategories = new ResourceCategoriesFacade(restClient);
            ScheduleTypes = new ScheduleTypesFacade(restClient);
            SchedulePatternTypes = new SchedulePatternTypesFacade(restClient);
            Qualifications = new QualificationsFacade(restClient);
            QualificationCategories = new QualificationCategoriesFacade(restClient);
            PaymentGatewayTransactionTypes = new PaymentGatewayTransactionTypesFacade(restClient);
            BookingCategories = new BookingCategoriesFacade(restClient);
            CurrencyTypes = new CurrencyTypesFacade(restClient);
            EmailProfiles = new EmailProfilesFacade(restClient);
            ContactPermissionCategories = new ContactPermissionCategoriesFacade(restClient);
            ContactPermissionTypes = new ContactPermissionTypesFacade(restClient);
            NScanAccessAreas = new NScanAccessAreasFacade(restClient);
            TemplateCategories = new TemplateCategoriesFacade(restClient);
            Organizations = new OrganizationsFacade(restClient);
            QueryElements = new QueryElementsFacade(restClient);
        }
    }
 

 
    public class ReferencedataBatch
    {
        private IRestClient restClient;
        public TemplateTypesFacadeBatch TemplateTypes {get; private set;}
        public AccountTypesFacadeBatch AccountTypes {get; private set;}
        public FormatsFacadeBatch Formats {get; private set;}
        public ListCategoriesFacadeBatch ListCategories {get; private set;}
        public PriceTypeReasonsFacadeBatch PriceTypeReasons {get; private set;}
        public ActionTypesFacadeBatch ActionTypes {get; private set;}
        public ActivityCategoriesFacadeBatch ActivityCategories {get; private set;}
        public ActivityTypesFacadeBatch ActivityTypes {get; private set;}
        public AddressTypesFacadeBatch AddressTypes {get; private set;}
        public AffiliationTypesFacadeBatch AffiliationTypes {get; private set;}
        public AliasTypesFacadeBatch AliasTypes {get; private set;}
        public AppealCategoriesFacadeBatch AppealCategories {get; private set;}
        public AssetTypesFacadeBatch AssetTypes {get; private set;}
        public AssociationTypesFacadeBatch AssociationTypes {get; private set;}
        public BatchTypeGroupsFacadeBatch BatchTypeGroups {get; private set;}
        public BatchTypesFacadeBatch BatchTypes {get; private set;}
        public BusinessUnitsFacadeBatch BusinessUnits {get; private set;}
        public ColorsFacadeBatch Colors {get; private set;}
        public ComposersFacadeBatch Composers {get; private set;}
        public ConstituencyTypesFacadeBatch ConstituencyTypes {get; private set;}
        public ConstituentGroupsFacadeBatch ConstituentGroups {get; private set;}
        public ConstituentInactivesFacadeBatch ConstituentInactives {get; private set;}
        public ConstituentTypeAffiliatesFacadeBatch ConstituentTypeAffiliates {get; private set;}
        public ConstituentTypesFacadeBatch ConstituentTypes {get; private set;}
        public ContactPointCategoryPurposesFacadeBatch ContactPointCategoryPurposes {get; private set;}
        public ContactPointCategoriesFacadeBatch ContactPointCategories {get; private set;}
        public ContactPointPurposesFacadeBatch ContactPointPurposes {get; private set;}
        public ContactTypesFacadeBatch ContactTypes {get; private set;}
        public ContributionDesignationsFacadeBatch ContributionDesignations {get; private set;}
        public ControlGroupsFacadeBatch ControlGroups {get; private set;}
        public CountriesFacadeBatch Countries {get; private set;}
        public CriterionOperatorsFacadeBatch CriterionOperators {get; private set;}
        public DeliveryMethodsFacadeBatch DeliveryMethods {get; private set;}
        public DesignationCodesFacadeBatch DesignationCodes {get; private set;}
        public DesignsFacadeBatch Designs {get; private set;}
        public DonationLevelsFacadeBatch DonationLevels {get; private set;}
        public ElectronicAddressTypesFacadeBatch ElectronicAddressTypes {get; private set;}
        public EmarketIndicatorsFacadeBatch EmarketIndicators {get; private set;}
        public ErasFacadeBatch Eras {get; private set;}
        public GLAccountsFacadeBatch GLAccounts {get; private set;}
        public InactiveReasonsFacadeBatch InactiveReasons {get; private set;}
        public InterestCategoriesFacadeBatch InterestCategories {get; private set;}
        public InterestTypesFacadeBatch InterestTypes {get; private set;}
        public KeywordCategoriesFacadeBatch KeywordCategories {get; private set;}
        public KeywordsFacadeBatch Keywords {get; private set;}
        public LanguagesFacadeBatch Languages {get; private set;}
        public LoginTypesFacadeBatch LoginTypes {get; private set;}
        public MailIndicatorsFacadeBatch MailIndicators {get; private set;}
        public MediaTypesFacadeBatch MediaTypes {get; private set;}
        public MembershipLevelCategoriesFacadeBatch MembershipLevelCategories {get; private set;}
        public NameStatusesFacadeBatch NameStatuses {get; private set;}
        public OrderCategoriesFacadeBatch OrderCategories {get; private set;}
        public OriginalSourcesFacadeBatch OriginalSources {get; private set;}
        public OriginsFacadeBatch Origins {get; private set;}
        public PackageTypesFacadeBatch PackageTypes {get; private set;}
        public PaymentMethodGroupsFacadeBatch PaymentMethodGroups {get; private set;}
        public PaymentTypesFacadeBatch PaymentTypes {get; private set;}
        public PerformanceStatusesFacadeBatch PerformanceStatuses {get; private set;}
        public PerformanceTypesFacadeBatch PerformanceTypes {get; private set;}
        public PhoneIndicatorsFacadeBatch PhoneIndicators {get; private set;}
        public PhoneTypesFacadeBatch PhoneTypes {get; private set;}
        public PlanPrioritiesFacadeBatch PlanPriorities {get; private set;}
        public PlanSourcesFacadeBatch PlanSources {get; private set;}
        public PlanStatusesFacadeBatch PlanStatuses {get; private set;}
        public PlanTypesFacadeBatch PlanTypes {get; private set;}
        public PortfolioCustomElementsFacadeBatch PortfolioCustomElements {get; private set;}
        public PrefixesFacadeBatch Prefixes {get; private set;}
        public PremieresFacadeBatch Premieres {get; private set;}
        public PriceCategoriesFacadeBatch PriceCategories {get; private set;}
        public PriceLayerTypesFacadeBatch PriceLayerTypes {get; private set;}
        public PriceTypeCategoriesFacadeBatch PriceTypeCategories {get; private set;}
        public PriceTypeGroupsFacadeBatch PriceTypeGroups {get; private set;}
        public PricingRuleCategoriesFacadeBatch PricingRuleCategories {get; private set;}
        public PricingRuleMessageTypesFacadeBatch PricingRuleMessageTypes {get; private set;}
        public PricingRuleTypesFacadeBatch PricingRuleTypes {get; private set;}
        public PrintersFacadeBatch Printers {get; private set;}
        public ProgramsFacadeBatch Programs {get; private set;}
        public ContactPointPurposeCategoriesFacadeBatch ContactPointPurposeCategories {get; private set;}
        public RankTypesFacadeBatch RankTypes {get; private set;}
        public ReferenceColumnsFacadeBatch ReferenceColumns {get; private set;}
        public ReferenceTablesFacadeBatch ReferenceTables {get; private set;}
        public RelationshipCategoriesFacadeBatch RelationshipCategories {get; private set;}
        public SalesChannelsFacadeBatch SalesChannels {get; private set;}
        public SalesLayoutButtonTypesFacadeBatch SalesLayoutButtonTypes {get; private set;}
        public SalutationTypesFacadeBatch SalutationTypes {get; private set;}
        public SeasonsFacadeBatch Seasons {get; private set;}
        public SeasonTypesFacadeBatch SeasonTypes {get; private set;}
        public SeatCodesFacadeBatch SeatCodes {get; private set;}
        public SeatStatusesFacadeBatch SeatStatuses {get; private set;}
        public SectionsFacadeBatch Sections {get; private set;}
        public ServiceResourcesFacadeBatch ServiceResources {get; private set;}
        public SourceGroupsFacadeBatch SourceGroups {get; private set;}
        public StatesFacadeBatch States {get; private set;}
        public StepTypesFacadeBatch StepTypes {get; private set;}
        public SubLineItemStatusesFacadeBatch SubLineItemStatuses {get; private set;}
        public SuffixesFacadeBatch Suffixes {get; private set;}
        public SurveyQuestionsFacadeBatch SurveyQuestions {get; private set;}
        public SystemDefaultsFacadeBatch SystemDefaults {get; private set;}
        public TheatersFacadeBatch Theaters {get; private set;}
        public TimeSlotsFacadeBatch TimeSlots {get; private set;}
        public UserGroupsFacadeBatch UserGroups {get; private set;}
        public WorkerRolesFacadeBatch WorkerRoles {get; private set;}
        public WorkerTypesFacadeBatch WorkerTypes {get; private set;}
        public ZoneGroupsFacadeBatch ZoneGroups {get; private set;}
        public DiscountTypesFacadeBatch DiscountTypes {get; private set;}
        public ReceiptSettingsFacadeBatch ReceiptSettings {get; private set;}
        public BillingTypesFacadeBatch BillingTypes {get; private set;}
        public BillingSchedulesFacadeBatch BillingSchedules {get; private set;}
        public SpecialActivityTypesFacadeBatch SpecialActivityTypes {get; private set;}
        public SpecialActivityStatusesFacadeBatch SpecialActivityStatuses {get; private set;}
        public HoldCodeCategoriesFacadeBatch HoldCodeCategories {get; private set;}
        public UpgradeCategoriesFacadeBatch UpgradeCategories {get; private set;}
        public GiftAidTypesFacadeBatch GiftAidTypes {get; private set;}
        public GiftAidStatusesFacadeBatch GiftAidStatuses {get; private set;}
        public GiftAidRatesFacadeBatch GiftAidRates {get; private set;}
        public GiftAidIneligibleReasonsFacadeBatch GiftAidIneligibleReasons {get; private set;}
        public GiftAidDocumentStatusesFacadeBatch GiftAidDocumentStatuses {get; private set;}
        public GiftAidContactMethodsFacadeBatch GiftAidContactMethods {get; private set;}
        public CardReaderTypesFacadeBatch CardReaderTypes {get; private set;}
        public MachineSettingsFacadeBatch MachineSettings {get; private set;}
        public ResourceCategoriesFacadeBatch ResourceCategories {get; private set;}
        public ScheduleTypesFacadeBatch ScheduleTypes {get; private set;}
        public SchedulePatternTypesFacadeBatch SchedulePatternTypes {get; private set;}
        public QualificationsFacadeBatch Qualifications {get; private set;}
        public QualificationCategoriesFacadeBatch QualificationCategories {get; private set;}
        public PaymentGatewayTransactionTypesFacadeBatch PaymentGatewayTransactionTypes {get; private set;}
        public BookingCategoriesFacadeBatch BookingCategories {get; private set;}
        public CurrencyTypesFacadeBatch CurrencyTypes {get; private set;}
        public EmailProfilesFacadeBatch EmailProfiles {get; private set;}
        public ContactPermissionCategoriesFacadeBatch ContactPermissionCategories {get; private set;}
        public ContactPermissionTypesFacadeBatch ContactPermissionTypes {get; private set;}
        public NScanAccessAreasFacadeBatch NScanAccessAreas {get; private set;}
        public TemplateCategoriesFacadeBatch TemplateCategories {get; private set;}
        public OrganizationsFacadeBatch Organizations {get; private set;}
        public QueryElementsFacadeBatch QueryElements {get; private set;}

        public ReferencedataBatch(IRestClient restClient)
        {
            this.restClient = restClient;
            TemplateTypes = new TemplateTypesFacadeBatch(restClient);
            AccountTypes = new AccountTypesFacadeBatch(restClient);
            Formats = new FormatsFacadeBatch(restClient);
            ListCategories = new ListCategoriesFacadeBatch(restClient);
            PriceTypeReasons = new PriceTypeReasonsFacadeBatch(restClient);
            ActionTypes = new ActionTypesFacadeBatch(restClient);
            ActivityCategories = new ActivityCategoriesFacadeBatch(restClient);
            ActivityTypes = new ActivityTypesFacadeBatch(restClient);
            AddressTypes = new AddressTypesFacadeBatch(restClient);
            AffiliationTypes = new AffiliationTypesFacadeBatch(restClient);
            AliasTypes = new AliasTypesFacadeBatch(restClient);
            AppealCategories = new AppealCategoriesFacadeBatch(restClient);
            AssetTypes = new AssetTypesFacadeBatch(restClient);
            AssociationTypes = new AssociationTypesFacadeBatch(restClient);
            BatchTypeGroups = new BatchTypeGroupsFacadeBatch(restClient);
            BatchTypes = new BatchTypesFacadeBatch(restClient);
            BusinessUnits = new BusinessUnitsFacadeBatch(restClient);
            Colors = new ColorsFacadeBatch(restClient);
            Composers = new ComposersFacadeBatch(restClient);
            ConstituencyTypes = new ConstituencyTypesFacadeBatch(restClient);
            ConstituentGroups = new ConstituentGroupsFacadeBatch(restClient);
            ConstituentInactives = new ConstituentInactivesFacadeBatch(restClient);
            ConstituentTypeAffiliates = new ConstituentTypeAffiliatesFacadeBatch(restClient);
            ConstituentTypes = new ConstituentTypesFacadeBatch(restClient);
            ContactPointCategoryPurposes = new ContactPointCategoryPurposesFacadeBatch(restClient);
            ContactPointCategories = new ContactPointCategoriesFacadeBatch(restClient);
            ContactPointPurposes = new ContactPointPurposesFacadeBatch(restClient);
            ContactTypes = new ContactTypesFacadeBatch(restClient);
            ContributionDesignations = new ContributionDesignationsFacadeBatch(restClient);
            ControlGroups = new ControlGroupsFacadeBatch(restClient);
            Countries = new CountriesFacadeBatch(restClient);
            CriterionOperators = new CriterionOperatorsFacadeBatch(restClient);
            DeliveryMethods = new DeliveryMethodsFacadeBatch(restClient);
            DesignationCodes = new DesignationCodesFacadeBatch(restClient);
            Designs = new DesignsFacadeBatch(restClient);
            DonationLevels = new DonationLevelsFacadeBatch(restClient);
            ElectronicAddressTypes = new ElectronicAddressTypesFacadeBatch(restClient);
            EmarketIndicators = new EmarketIndicatorsFacadeBatch(restClient);
            Eras = new ErasFacadeBatch(restClient);
            GLAccounts = new GLAccountsFacadeBatch(restClient);
            InactiveReasons = new InactiveReasonsFacadeBatch(restClient);
            InterestCategories = new InterestCategoriesFacadeBatch(restClient);
            InterestTypes = new InterestTypesFacadeBatch(restClient);
            KeywordCategories = new KeywordCategoriesFacadeBatch(restClient);
            Keywords = new KeywordsFacadeBatch(restClient);
            Languages = new LanguagesFacadeBatch(restClient);
            LoginTypes = new LoginTypesFacadeBatch(restClient);
            MailIndicators = new MailIndicatorsFacadeBatch(restClient);
            MediaTypes = new MediaTypesFacadeBatch(restClient);
            MembershipLevelCategories = new MembershipLevelCategoriesFacadeBatch(restClient);
            NameStatuses = new NameStatusesFacadeBatch(restClient);
            OrderCategories = new OrderCategoriesFacadeBatch(restClient);
            OriginalSources = new OriginalSourcesFacadeBatch(restClient);
            Origins = new OriginsFacadeBatch(restClient);
            PackageTypes = new PackageTypesFacadeBatch(restClient);
            PaymentMethodGroups = new PaymentMethodGroupsFacadeBatch(restClient);
            PaymentTypes = new PaymentTypesFacadeBatch(restClient);
            PerformanceStatuses = new PerformanceStatusesFacadeBatch(restClient);
            PerformanceTypes = new PerformanceTypesFacadeBatch(restClient);
            PhoneIndicators = new PhoneIndicatorsFacadeBatch(restClient);
            PhoneTypes = new PhoneTypesFacadeBatch(restClient);
            PlanPriorities = new PlanPrioritiesFacadeBatch(restClient);
            PlanSources = new PlanSourcesFacadeBatch(restClient);
            PlanStatuses = new PlanStatusesFacadeBatch(restClient);
            PlanTypes = new PlanTypesFacadeBatch(restClient);
            PortfolioCustomElements = new PortfolioCustomElementsFacadeBatch(restClient);
            Prefixes = new PrefixesFacadeBatch(restClient);
            Premieres = new PremieresFacadeBatch(restClient);
            PriceCategories = new PriceCategoriesFacadeBatch(restClient);
            PriceLayerTypes = new PriceLayerTypesFacadeBatch(restClient);
            PriceTypeCategories = new PriceTypeCategoriesFacadeBatch(restClient);
            PriceTypeGroups = new PriceTypeGroupsFacadeBatch(restClient);
            PricingRuleCategories = new PricingRuleCategoriesFacadeBatch(restClient);
            PricingRuleMessageTypes = new PricingRuleMessageTypesFacadeBatch(restClient);
            PricingRuleTypes = new PricingRuleTypesFacadeBatch(restClient);
            Printers = new PrintersFacadeBatch(restClient);
            Programs = new ProgramsFacadeBatch(restClient);
            ContactPointPurposeCategories = new ContactPointPurposeCategoriesFacadeBatch(restClient);
            RankTypes = new RankTypesFacadeBatch(restClient);
            ReferenceColumns = new ReferenceColumnsFacadeBatch(restClient);
            ReferenceTables = new ReferenceTablesFacadeBatch(restClient);
            RelationshipCategories = new RelationshipCategoriesFacadeBatch(restClient);
            SalesChannels = new SalesChannelsFacadeBatch(restClient);
            SalesLayoutButtonTypes = new SalesLayoutButtonTypesFacadeBatch(restClient);
            SalutationTypes = new SalutationTypesFacadeBatch(restClient);
            Seasons = new SeasonsFacadeBatch(restClient);
            SeasonTypes = new SeasonTypesFacadeBatch(restClient);
            SeatCodes = new SeatCodesFacadeBatch(restClient);
            SeatStatuses = new SeatStatusesFacadeBatch(restClient);
            Sections = new SectionsFacadeBatch(restClient);
            ServiceResources = new ServiceResourcesFacadeBatch(restClient);
            SourceGroups = new SourceGroupsFacadeBatch(restClient);
            States = new StatesFacadeBatch(restClient);
            StepTypes = new StepTypesFacadeBatch(restClient);
            SubLineItemStatuses = new SubLineItemStatusesFacadeBatch(restClient);
            Suffixes = new SuffixesFacadeBatch(restClient);
            SurveyQuestions = new SurveyQuestionsFacadeBatch(restClient);
            SystemDefaults = new SystemDefaultsFacadeBatch(restClient);
            Theaters = new TheatersFacadeBatch(restClient);
            TimeSlots = new TimeSlotsFacadeBatch(restClient);
            UserGroups = new UserGroupsFacadeBatch(restClient);
            WorkerRoles = new WorkerRolesFacadeBatch(restClient);
            WorkerTypes = new WorkerTypesFacadeBatch(restClient);
            ZoneGroups = new ZoneGroupsFacadeBatch(restClient);
            DiscountTypes = new DiscountTypesFacadeBatch(restClient);
            ReceiptSettings = new ReceiptSettingsFacadeBatch(restClient);
            BillingTypes = new BillingTypesFacadeBatch(restClient);
            BillingSchedules = new BillingSchedulesFacadeBatch(restClient);
            SpecialActivityTypes = new SpecialActivityTypesFacadeBatch(restClient);
            SpecialActivityStatuses = new SpecialActivityStatusesFacadeBatch(restClient);
            HoldCodeCategories = new HoldCodeCategoriesFacadeBatch(restClient);
            UpgradeCategories = new UpgradeCategoriesFacadeBatch(restClient);
            GiftAidTypes = new GiftAidTypesFacadeBatch(restClient);
            GiftAidStatuses = new GiftAidStatusesFacadeBatch(restClient);
            GiftAidRates = new GiftAidRatesFacadeBatch(restClient);
            GiftAidIneligibleReasons = new GiftAidIneligibleReasonsFacadeBatch(restClient);
            GiftAidDocumentStatuses = new GiftAidDocumentStatusesFacadeBatch(restClient);
            GiftAidContactMethods = new GiftAidContactMethodsFacadeBatch(restClient);
            CardReaderTypes = new CardReaderTypesFacadeBatch(restClient);
            MachineSettings = new MachineSettingsFacadeBatch(restClient);
            ResourceCategories = new ResourceCategoriesFacadeBatch(restClient);
            ScheduleTypes = new ScheduleTypesFacadeBatch(restClient);
            SchedulePatternTypes = new SchedulePatternTypesFacadeBatch(restClient);
            Qualifications = new QualificationsFacadeBatch(restClient);
            QualificationCategories = new QualificationCategoriesFacadeBatch(restClient);
            PaymentGatewayTransactionTypes = new PaymentGatewayTransactionTypesFacadeBatch(restClient);
            BookingCategories = new BookingCategoriesFacadeBatch(restClient);
            CurrencyTypes = new CurrencyTypesFacadeBatch(restClient);
            EmailProfiles = new EmailProfilesFacadeBatch(restClient);
            ContactPermissionCategories = new ContactPermissionCategoriesFacadeBatch(restClient);
            ContactPermissionTypes = new ContactPermissionTypesFacadeBatch(restClient);
            NScanAccessAreas = new NScanAccessAreasFacadeBatch(restClient);
            TemplateCategories = new TemplateCategoriesFacadeBatch(restClient);
            Organizations = new OrganizationsFacadeBatch(restClient);
            QueryElements = new QueryElementsFacadeBatch(restClient);
        }
    }
 

 
    public class Reporting
    {
        private IRestClient restClient;
        public ReportRequestsFacade ReportRequests {get; private set;}
        public AuditLogsFacade AuditLogs {get; private set;}
        public ReportsFacade Reports {get; private set;}
        public OutputSetsFacade OutputSets {get; private set;}

        public Reporting(IRestClient restClient)
        {
            this.restClient = restClient;
            ReportRequests = new ReportRequestsFacade(restClient);
            AuditLogs = new AuditLogsFacade(restClient);
            Reports = new ReportsFacade(restClient);
            OutputSets = new OutputSetsFacade(restClient);
        }
    }
 

 
    public class ReportingBatch
    {
        private IRestClient restClient;
        public ReportRequestsFacadeBatch ReportRequests {get; private set;}
        public AuditLogsFacadeBatch AuditLogs {get; private set;}
        public ReportsFacadeBatch Reports {get; private set;}
        public OutputSetsFacadeBatch OutputSets {get; private set;}

        public ReportingBatch(IRestClient restClient)
        {
            this.restClient = restClient;
            ReportRequests = new ReportRequestsFacadeBatch(restClient);
            AuditLogs = new AuditLogsFacadeBatch(restClient);
            Reports = new ReportsFacadeBatch(restClient);
            OutputSets = new OutputSetsFacadeBatch(restClient);
        }
    }
 

 
    public class Security
    {
        private IRestClient restClient;
        public DivisionsFacade Divisions {get; private set;}
        public ReferenceTableUserGroupsFacade ReferenceTableUserGroups {get; private set;}
        public SecurityUserGroupsFacade SecurityUserGroups {get; private set;}
        public UserPreferencesFacade UserPreferences {get; private set;}
        public AuthenticateFacade Authenticate {get; private set;}
        public ObjectPermissionsFacade ObjectPermissions {get; private set;}
        public ValidateWebLoginFacade ValidateWebLogin {get; private set;}
        public UsersFacade Users {get; private set;}
        public ContextInformationFacade ContextInformation {get; private set;}

        public Security(IRestClient restClient)
        {
            this.restClient = restClient;
            Divisions = new DivisionsFacade(restClient);
            ReferenceTableUserGroups = new ReferenceTableUserGroupsFacade(restClient);
            SecurityUserGroups = new SecurityUserGroupsFacade(restClient);
            UserPreferences = new UserPreferencesFacade(restClient);
            Authenticate = new AuthenticateFacade(restClient);
            ObjectPermissions = new ObjectPermissionsFacade(restClient);
            ValidateWebLogin = new ValidateWebLoginFacade(restClient);
            Users = new UsersFacade(restClient);
            ContextInformation = new ContextInformationFacade(restClient);
        }
    }
 

 
    public class SecurityBatch
    {
        private IRestClient restClient;
        public DivisionsFacadeBatch Divisions {get; private set;}
        public ReferenceTableUserGroupsFacadeBatch ReferenceTableUserGroups {get; private set;}
        public SecurityUserGroupsFacadeBatch SecurityUserGroups {get; private set;}
        public UserPreferencesFacadeBatch UserPreferences {get; private set;}
        public AuthenticateFacadeBatch Authenticate {get; private set;}
        public ObjectPermissionsFacadeBatch ObjectPermissions {get; private set;}
        public ValidateWebLoginFacadeBatch ValidateWebLogin {get; private set;}
        public UsersFacadeBatch Users {get; private set;}
        public ContextInformationFacadeBatch ContextInformation {get; private set;}

        public SecurityBatch(IRestClient restClient)
        {
            this.restClient = restClient;
            Divisions = new DivisionsFacadeBatch(restClient);
            ReferenceTableUserGroups = new ReferenceTableUserGroupsFacadeBatch(restClient);
            SecurityUserGroups = new SecurityUserGroupsFacadeBatch(restClient);
            UserPreferences = new UserPreferencesFacadeBatch(restClient);
            Authenticate = new AuthenticateFacadeBatch(restClient);
            ObjectPermissions = new ObjectPermissionsFacadeBatch(restClient);
            ValidateWebLogin = new ValidateWebLoginFacadeBatch(restClient);
            Users = new UsersFacadeBatch(restClient);
            ContextInformation = new ContextInformationFacadeBatch(restClient);
        }
    }
 

 
    /// 
    public class TemplatesFacade
    {
        private IRestClient restClient;

        public TemplatesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<Templates>> GetAll()
        {
            return await restClient.AtUrl("Templates/").Get<Templates>();
        }

        /// 
        public async Task<RestResponse<TemplateSummaries>> GetAllSummaries()
        {
            return await restClient.AtUrl("Templates/Summaries").Get<TemplateSummaries>();
        }

        /// <summary>
        /// Get the details of a template by id.
        /// </summary>
        /// <param name="templateId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Template>> Get(string templateId)
        {
             var urlTemplate = "Templates/{0}";
             urlTemplate = string.Format(urlTemplate, templateId);
            return await restClient.AtUrl(urlTemplate).Get<Template>();
        }

        /// <summary>
        /// Create a new template
        /// </summary>
        /// <param name="template"></param>
        /// <returns></returns>
        public async Task<RestResponse<Template>> Create(Template template)
        {
            return await restClient.AtUrl("Templates/").Post<Template, Template>(template);
        }

        /// <summary>
        /// Update an existing template
        /// </summary>
        /// <param name="templateId"></param>
        /// <param name="template"></param>
        /// <returns></returns>
        public async Task<RestResponse<Template>> Update(string templateId, Template template)
        {
             var urlTemplate = "Templates/{0}";
             urlTemplate = string.Format(urlTemplate, templateId);
            return await restClient.AtUrl(urlTemplate).Put<Template, Template>(template);
        }

        /// <summary>
        /// Delete a template
        /// </summary>
        /// <param name="templateId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string templateId)
        {
             var urlTemplate = "Templates/{0}";
             urlTemplate = string.Format(urlTemplate, templateId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Get a formatted html body for an order confirmation
        /// </summary>
        /// <param name="templateId"></param>
        /// <param name="orderId"></param>
        /// <returns></returns>
        public async Task<RestResponse<TemplateBody>> GetOrderConfirmation(string templateId, string orderId)
        {
             var urlTemplate = "Templates/{0}/OrderConfirmation?orderId={1}";
             urlTemplate = string.Format(urlTemplate, templateId, orderId);
            return await restClient.AtUrl(urlTemplate).Get<TemplateBody>();
        }

        /// <summary>
        /// Return the rendered order confirmation template for the provided order Id.
        /// </summary>
        /// <param name="request"></param>
        /// <param name="orderId"></param>
        /// <returns></returns>
        public async Task<RestResponse<TemplateBody>> RenderOrderConfirmation(TemplateBody request, string orderId)
        {
            return await restClient.AtUrl("Templates/Render/OrderConfirmation").Post<string, TemplateBody>(orderId);
        }

        /// <summary>
        /// Get a formatted html body for login credentials
        /// </summary>
        /// <param name="templateId"></param>
        /// <param name="loginId"></param>
        /// <returns></returns>
        public async Task<RestResponse<TemplateBody>> GetLoginCredentials(string templateId, string loginId)
        {
             var urlTemplate = "Templates/{0}/LoginCredentials?loginId={1}";
             urlTemplate = string.Format(urlTemplate, templateId, loginId);
            return await restClient.AtUrl(urlTemplate).Get<TemplateBody>();
        }

        /// <summary>
        /// Return the rendered login credentials template for the provided web login id.
        /// </summary>
        /// <param name="request"></param>
        /// <param name="loginId"></param>
        /// <returns></returns>
        public async Task<RestResponse<TemplateBody>> RenderLoginCredentials(TemplateBody request, string loginId)
        {
            return await restClient.AtUrl("Templates/Render/LoginCredentials").Post<string, TemplateBody>(loginId);
        }

    }
 

 
    /// 
    public class TemplatesFacadeBatch
    {
        private IRestClient restClient;

        public TemplatesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Templates";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "Templates/";

            return bRequest;
        }

        /// 
        public Request GetAllSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TemplateSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "Templates/Summaries";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a template by id.
        /// </summary>
        /// <param name="templateId"></param>
        /// <returns></returns>
        public Request Get(string templateId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Template";
            bRequest.Content = null;

            var urlTemplate = "Templates/{0}";
            urlTemplate = string.Format(urlTemplate, templateId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new template
        /// </summary>
        /// <param name="template"></param>
        /// <returns></returns>
        public Request Create(Template template, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Template";
            bRequest.Content = template;

            bRequest.Uri = restClient.GetBaseUrl() + "Templates/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing template
        /// </summary>
        /// <param name="templateId"></param>
        /// <param name="template"></param>
        /// <returns></returns>
        public Request Update(string templateId, Template template, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Template";
            bRequest.Content = template;

            var urlTemplate = "Templates/{0}";
            urlTemplate = string.Format(urlTemplate, templateId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete a template
        /// </summary>
        /// <param name="templateId"></param>
        public Request Delete(string templateId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Templates/{0}";
            urlTemplate = string.Format(urlTemplate, templateId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get a formatted html body for an order confirmation
        /// </summary>
        /// <param name="templateId"></param>
        /// <param name="orderId"></param>
        /// <returns></returns>
        public Request GetOrderConfirmation(string templateId, string orderId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TemplateBody";
            bRequest.Content = null;

            var urlTemplate = "Templates/{0}/OrderConfirmation?orderId={1}";
            urlTemplate = string.Format(urlTemplate, templateId, orderId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Return the rendered order confirmation template for the provided order Id.
        /// </summary>
        /// <param name="request"></param>
        /// <param name="orderId"></param>
        /// <returns></returns>
        public Request RenderOrderConfirmation(TemplateBody request, string orderId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TemplateBody";
            bRequest.Content = orderId;

            bRequest.Uri = restClient.GetBaseUrl() + "Templates/Render/OrderConfirmation";

            return bRequest;
        }

        /// <summary>
        /// Get a formatted html body for login credentials
        /// </summary>
        /// <param name="templateId"></param>
        /// <param name="loginId"></param>
        /// <returns></returns>
        public Request GetLoginCredentials(string templateId, string loginId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TemplateBody";
            bRequest.Content = null;

            var urlTemplate = "Templates/{0}/LoginCredentials?loginId={1}";
            urlTemplate = string.Format(urlTemplate, templateId, loginId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Return the rendered login credentials template for the provided web login id.
        /// </summary>
        /// <param name="request"></param>
        /// <param name="loginId"></param>
        /// <returns></returns>
        public Request RenderLoginCredentials(TemplateBody request, string loginId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TemplateBody";
            bRequest.Content = loginId;

            bRequest.Uri = restClient.GetBaseUrl() + "Templates/Render/LoginCredentials";

            return bRequest;
        }

    }
 

 
    public class TessituraServiceFacade
    {
        private IRestClient restClient;
        public Admin Admin {get; private set;}
        public Crm Crm {get; private set;}
        public CustomFacade CustomFacade {get; private set;}
        public DiagnosticsFacade DiagnosticsFacade {get; private set;}
        public EmailsFacade EmailsFacade {get; private set;}
        public Eventsmanagement Eventsmanagement {get; private set;}
        public Finance Finance {get; private set;}
        public Paymentgateway Paymentgateway {get; private set;}
        public Referencedata Referencedata {get; private set;}
        public Reporting Reporting {get; private set;}
        public Security Security {get; private set;}
        public TemplatesFacade TemplatesFacade {get; private set;}
        public Txn Txn {get; private set;}
        public Web Web {get; private set;}
        public BatchFacade BatchFacade {get; private set;}
        public IRestClient RestClient {get {return restClient;} }

        public TessituraServiceFacade(string baseUri, int timeout, bool shouldValidateResponse = true, IRestClient restClient = null)
        {
            this.restClient = restClient ?? new RestClient(baseUri, timeout, shouldValidateResponse);
            Admin = new Admin(this.restClient);
            Crm = new Crm(this.restClient);
            CustomFacade = new CustomFacade(this.restClient);
            DiagnosticsFacade = new DiagnosticsFacade(this.restClient);
            EmailsFacade = new EmailsFacade(this.restClient);
            Eventsmanagement = new Eventsmanagement(this.restClient);
            Finance = new Finance(this.restClient);
            Paymentgateway = new Paymentgateway(this.restClient);
            Referencedata = new Referencedata(this.restClient);
            Reporting = new Reporting(this.restClient);
            Security = new Security(this.restClient);
            TemplatesFacade = new TemplatesFacade(this.restClient);
            Txn = new Txn(this.restClient);
            Web = new Web(this.restClient);
        BatchFacade = new BatchFacade(this.restClient);
        }

        public void SetCredentials(UserCredentials userCredentials)
        {
            restClient.WithHeader("Authorization", userCredentials.GetAuthHeaderString());
        }
    }
 

 
    public class Txn
    {
        private IRestClient restClient;
        public InvoiceBillingFacade InvoiceBilling {get; private set;}
        public OrderBillingFacade OrderBilling {get; private set;}
        public PledgeBillingFacade PledgeBilling {get; private set;}
        public SubLineItemsFacade SubLineItems {get; private set;}
        public TitlesFacade Titles {get; private set;}
        public ProductionsFacade Productions {get; private set;}
        public ProductKeywordsFacade ProductKeywords {get; private set;}
        public PaymentSignaturesFacade PaymentSignatures {get; private set;}
        public ProductsFacade Products {get; private set;}
        public PaymentsFacade Payments {get; private set;}
        public CreditsFacade Credits {get; private set;}
        public WebContentsFacade WebContents {get; private set;}
        public ContributionFacade Contribution {get; private set;}
        public EmailResponsesFacade EmailResponses {get; private set;}
        public FacilitiesFacade Facilities {get; private set;}
        public FeesFacade Fees {get; private set;}
        public ModeOfSaleCategoriesFacade ModeOfSaleCategories {get; private set;}
        public ModeOfSaleOffersFacade ModeOfSaleOffers {get; private set;}
        public ModeOfSalePriceTypesFacade ModeOfSalePriceTypes {get; private set;}
        public ModesOfSaleFacade ModesOfSale {get; private set;}
        public OrdersFacade Orders {get; private set;}
        public PackagePriceTypesFacade PackagePriceTypes {get; private set;}
        public PackagesFacade Packages {get; private set;}
        public PaymentMethodsFacade PaymentMethods {get; private set;}
        public PerformanceGroupsFacade PerformanceGroups {get; private set;}
        public PerformancePackageModeOfSalesFacade PerformancePackageModeOfSales {get; private set;}
        public PerformancePriceLayersFacade PerformancePriceLayers {get; private set;}
        public PerformancePricesFacade PerformancePrices {get; private set;}
        public PerformancePriceTypesFacade PerformancePriceTypes {get; private set;}
        public PerformancesFacade Performances {get; private set;}
        public PriceEventsFacade PriceEvents {get; private set;}
        public PriceTemplatesFacade PriceTemplates {get; private set;}
        public PriceTypesFacade PriceTypes {get; private set;}
        public PriceTypeUserGroupsFacade PriceTypeUserGroups {get; private set;}
        public PricingRulesFacade PricingRules {get; private set;}
        public PricingRuleSetsFacade PricingRuleSets {get; private set;}
        public ProductionSeasonMembershipOrganizationsFacade ProductionSeasonMembershipOrganizations {get; private set;}
        public ProductionSeasonsFacade ProductionSeasons {get; private set;}
        public SalesLayoutsFacade SalesLayouts {get; private set;}
        public SurveyResponsesFacade SurveyResponses {get; private set;}
        public TemplatePricesFacade TemplatePrices {get; private set;}
        public TemplatePriceTypesFacade TemplatePriceTypes {get; private set;}
        public ZoneMapsFacade ZoneMaps {get; private set;}
        public ZonesFacade Zones {get; private set;}
        public ArtistsFacade Artists {get; private set;}
        public ModeOfSaleSurveyQuestionsFacade ModeOfSaleSurveyQuestions {get; private set;}
        public HoldCodesFacade HoldCodes {get; private set;}
        public BulkCopySetsFacade BulkCopySets {get; private set;}
        public BulkDailyCopyExclusionsFacade BulkDailyCopyExclusions {get; private set;}
        public HoldCodeUserGroupsFacade HoldCodeUserGroups {get; private set;}
        public PaymentMethodUserGroupsFacade PaymentMethodUserGroups {get; private set;}

        public Txn(IRestClient restClient)
        {
            this.restClient = restClient;
            InvoiceBilling = new InvoiceBillingFacade(restClient);
            OrderBilling = new OrderBillingFacade(restClient);
            PledgeBilling = new PledgeBillingFacade(restClient);
            SubLineItems = new SubLineItemsFacade(restClient);
            Titles = new TitlesFacade(restClient);
            Productions = new ProductionsFacade(restClient);
            ProductKeywords = new ProductKeywordsFacade(restClient);
            PaymentSignatures = new PaymentSignaturesFacade(restClient);
            Products = new ProductsFacade(restClient);
            Payments = new PaymentsFacade(restClient);
            Credits = new CreditsFacade(restClient);
            WebContents = new WebContentsFacade(restClient);
            Contribution = new ContributionFacade(restClient);
            EmailResponses = new EmailResponsesFacade(restClient);
            Facilities = new FacilitiesFacade(restClient);
            Fees = new FeesFacade(restClient);
            ModeOfSaleCategories = new ModeOfSaleCategoriesFacade(restClient);
            ModeOfSaleOffers = new ModeOfSaleOffersFacade(restClient);
            ModeOfSalePriceTypes = new ModeOfSalePriceTypesFacade(restClient);
            ModesOfSale = new ModesOfSaleFacade(restClient);
            Orders = new OrdersFacade(restClient);
            PackagePriceTypes = new PackagePriceTypesFacade(restClient);
            Packages = new PackagesFacade(restClient);
            PaymentMethods = new PaymentMethodsFacade(restClient);
            PerformanceGroups = new PerformanceGroupsFacade(restClient);
            PerformancePackageModeOfSales = new PerformancePackageModeOfSalesFacade(restClient);
            PerformancePriceLayers = new PerformancePriceLayersFacade(restClient);
            PerformancePrices = new PerformancePricesFacade(restClient);
            PerformancePriceTypes = new PerformancePriceTypesFacade(restClient);
            Performances = new PerformancesFacade(restClient);
            PriceEvents = new PriceEventsFacade(restClient);
            PriceTemplates = new PriceTemplatesFacade(restClient);
            PriceTypes = new PriceTypesFacade(restClient);
            PriceTypeUserGroups = new PriceTypeUserGroupsFacade(restClient);
            PricingRules = new PricingRulesFacade(restClient);
            PricingRuleSets = new PricingRuleSetsFacade(restClient);
            ProductionSeasonMembershipOrganizations = new ProductionSeasonMembershipOrganizationsFacade(restClient);
            ProductionSeasons = new ProductionSeasonsFacade(restClient);
            SalesLayouts = new SalesLayoutsFacade(restClient);
            SurveyResponses = new SurveyResponsesFacade(restClient);
            TemplatePrices = new TemplatePricesFacade(restClient);
            TemplatePriceTypes = new TemplatePriceTypesFacade(restClient);
            ZoneMaps = new ZoneMapsFacade(restClient);
            Zones = new ZonesFacade(restClient);
            Artists = new ArtistsFacade(restClient);
            ModeOfSaleSurveyQuestions = new ModeOfSaleSurveyQuestionsFacade(restClient);
            HoldCodes = new HoldCodesFacade(restClient);
            BulkCopySets = new BulkCopySetsFacade(restClient);
            BulkDailyCopyExclusions = new BulkDailyCopyExclusionsFacade(restClient);
            HoldCodeUserGroups = new HoldCodeUserGroupsFacade(restClient);
            PaymentMethodUserGroups = new PaymentMethodUserGroupsFacade(restClient);
        }
    }
 

 
    public class TxnBatch
    {
        private IRestClient restClient;
        public InvoiceBillingFacadeBatch InvoiceBilling {get; private set;}
        public OrderBillingFacadeBatch OrderBilling {get; private set;}
        public PledgeBillingFacadeBatch PledgeBilling {get; private set;}
        public SubLineItemsFacadeBatch SubLineItems {get; private set;}
        public TitlesFacadeBatch Titles {get; private set;}
        public ProductionsFacadeBatch Productions {get; private set;}
        public ProductKeywordsFacadeBatch ProductKeywords {get; private set;}
        public PaymentSignaturesFacadeBatch PaymentSignatures {get; private set;}
        public ProductsFacadeBatch Products {get; private set;}
        public PaymentsFacadeBatch Payments {get; private set;}
        public CreditsFacadeBatch Credits {get; private set;}
        public WebContentsFacadeBatch WebContents {get; private set;}
        public ContributionFacadeBatch Contribution {get; private set;}
        public EmailResponsesFacadeBatch EmailResponses {get; private set;}
        public FacilitiesFacadeBatch Facilities {get; private set;}
        public FeesFacadeBatch Fees {get; private set;}
        public ModeOfSaleCategoriesFacadeBatch ModeOfSaleCategories {get; private set;}
        public ModeOfSaleOffersFacadeBatch ModeOfSaleOffers {get; private set;}
        public ModeOfSalePriceTypesFacadeBatch ModeOfSalePriceTypes {get; private set;}
        public ModesOfSaleFacadeBatch ModesOfSale {get; private set;}
        public OrdersFacadeBatch Orders {get; private set;}
        public PackagePriceTypesFacadeBatch PackagePriceTypes {get; private set;}
        public PackagesFacadeBatch Packages {get; private set;}
        public PaymentMethodsFacadeBatch PaymentMethods {get; private set;}
        public PerformanceGroupsFacadeBatch PerformanceGroups {get; private set;}
        public PerformancePackageModeOfSalesFacadeBatch PerformancePackageModeOfSales {get; private set;}
        public PerformancePriceLayersFacadeBatch PerformancePriceLayers {get; private set;}
        public PerformancePricesFacadeBatch PerformancePrices {get; private set;}
        public PerformancePriceTypesFacadeBatch PerformancePriceTypes {get; private set;}
        public PerformancesFacadeBatch Performances {get; private set;}
        public PriceEventsFacadeBatch PriceEvents {get; private set;}
        public PriceTemplatesFacadeBatch PriceTemplates {get; private set;}
        public PriceTypesFacadeBatch PriceTypes {get; private set;}
        public PriceTypeUserGroupsFacadeBatch PriceTypeUserGroups {get; private set;}
        public PricingRulesFacadeBatch PricingRules {get; private set;}
        public PricingRuleSetsFacadeBatch PricingRuleSets {get; private set;}
        public ProductionSeasonMembershipOrganizationsFacadeBatch ProductionSeasonMembershipOrganizations {get; private set;}
        public ProductionSeasonsFacadeBatch ProductionSeasons {get; private set;}
        public SalesLayoutsFacadeBatch SalesLayouts {get; private set;}
        public SurveyResponsesFacadeBatch SurveyResponses {get; private set;}
        public TemplatePricesFacadeBatch TemplatePrices {get; private set;}
        public TemplatePriceTypesFacadeBatch TemplatePriceTypes {get; private set;}
        public ZoneMapsFacadeBatch ZoneMaps {get; private set;}
        public ZonesFacadeBatch Zones {get; private set;}
        public ArtistsFacadeBatch Artists {get; private set;}
        public ModeOfSaleSurveyQuestionsFacadeBatch ModeOfSaleSurveyQuestions {get; private set;}
        public HoldCodesFacadeBatch HoldCodes {get; private set;}
        public BulkCopySetsFacadeBatch BulkCopySets {get; private set;}
        public BulkDailyCopyExclusionsFacadeBatch BulkDailyCopyExclusions {get; private set;}
        public HoldCodeUserGroupsFacadeBatch HoldCodeUserGroups {get; private set;}
        public PaymentMethodUserGroupsFacadeBatch PaymentMethodUserGroups {get; private set;}

        public TxnBatch(IRestClient restClient)
        {
            this.restClient = restClient;
            InvoiceBilling = new InvoiceBillingFacadeBatch(restClient);
            OrderBilling = new OrderBillingFacadeBatch(restClient);
            PledgeBilling = new PledgeBillingFacadeBatch(restClient);
            SubLineItems = new SubLineItemsFacadeBatch(restClient);
            Titles = new TitlesFacadeBatch(restClient);
            Productions = new ProductionsFacadeBatch(restClient);
            ProductKeywords = new ProductKeywordsFacadeBatch(restClient);
            PaymentSignatures = new PaymentSignaturesFacadeBatch(restClient);
            Products = new ProductsFacadeBatch(restClient);
            Payments = new PaymentsFacadeBatch(restClient);
            Credits = new CreditsFacadeBatch(restClient);
            WebContents = new WebContentsFacadeBatch(restClient);
            Contribution = new ContributionFacadeBatch(restClient);
            EmailResponses = new EmailResponsesFacadeBatch(restClient);
            Facilities = new FacilitiesFacadeBatch(restClient);
            Fees = new FeesFacadeBatch(restClient);
            ModeOfSaleCategories = new ModeOfSaleCategoriesFacadeBatch(restClient);
            ModeOfSaleOffers = new ModeOfSaleOffersFacadeBatch(restClient);
            ModeOfSalePriceTypes = new ModeOfSalePriceTypesFacadeBatch(restClient);
            ModesOfSale = new ModesOfSaleFacadeBatch(restClient);
            Orders = new OrdersFacadeBatch(restClient);
            PackagePriceTypes = new PackagePriceTypesFacadeBatch(restClient);
            Packages = new PackagesFacadeBatch(restClient);
            PaymentMethods = new PaymentMethodsFacadeBatch(restClient);
            PerformanceGroups = new PerformanceGroupsFacadeBatch(restClient);
            PerformancePackageModeOfSales = new PerformancePackageModeOfSalesFacadeBatch(restClient);
            PerformancePriceLayers = new PerformancePriceLayersFacadeBatch(restClient);
            PerformancePrices = new PerformancePricesFacadeBatch(restClient);
            PerformancePriceTypes = new PerformancePriceTypesFacadeBatch(restClient);
            Performances = new PerformancesFacadeBatch(restClient);
            PriceEvents = new PriceEventsFacadeBatch(restClient);
            PriceTemplates = new PriceTemplatesFacadeBatch(restClient);
            PriceTypes = new PriceTypesFacadeBatch(restClient);
            PriceTypeUserGroups = new PriceTypeUserGroupsFacadeBatch(restClient);
            PricingRules = new PricingRulesFacadeBatch(restClient);
            PricingRuleSets = new PricingRuleSetsFacadeBatch(restClient);
            ProductionSeasonMembershipOrganizations = new ProductionSeasonMembershipOrganizationsFacadeBatch(restClient);
            ProductionSeasons = new ProductionSeasonsFacadeBatch(restClient);
            SalesLayouts = new SalesLayoutsFacadeBatch(restClient);
            SurveyResponses = new SurveyResponsesFacadeBatch(restClient);
            TemplatePrices = new TemplatePricesFacadeBatch(restClient);
            TemplatePriceTypes = new TemplatePriceTypesFacadeBatch(restClient);
            ZoneMaps = new ZoneMapsFacadeBatch(restClient);
            Zones = new ZonesFacadeBatch(restClient);
            Artists = new ArtistsFacadeBatch(restClient);
            ModeOfSaleSurveyQuestions = new ModeOfSaleSurveyQuestionsFacadeBatch(restClient);
            HoldCodes = new HoldCodesFacadeBatch(restClient);
            BulkCopySets = new BulkCopySetsFacadeBatch(restClient);
            BulkDailyCopyExclusions = new BulkDailyCopyExclusionsFacadeBatch(restClient);
            HoldCodeUserGroups = new HoldCodeUserGroupsFacadeBatch(restClient);
            PaymentMethodUserGroups = new PaymentMethodUserGroupsFacadeBatch(restClient);
        }
    }
 

 
    public class Web
    {
        private IRestClient restClient;
        public RegistrationFacade Registration {get; private set;}
        public SessionFacade Session {get; private set;}
        public CartFacade Cart {get; private set;}

        public Web(IRestClient restClient)
        {
            this.restClient = restClient;
            Registration = new RegistrationFacade(restClient);
            Session = new SessionFacade(restClient);
            Cart = new CartFacade(restClient);
        }
    }
 

 
    public class WebBatch
    {
        private IRestClient restClient;
        public RegistrationFacadeBatch Registration {get; private set;}
        public SessionFacadeBatch Session {get; private set;}
        public CartFacadeBatch Cart {get; private set;}

        public WebBatch(IRestClient restClient)
        {
            this.restClient = restClient;
            Registration = new RegistrationFacadeBatch(restClient);
            Session = new SessionFacadeBatch(restClient);
            Cart = new CartFacadeBatch(restClient);
        }
    }
 

 
    /// 
    public class UpgradeLogsFacade
    {
        private IRestClient restClient;

        public UpgradeLogsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<UpgradeLogs>> GetAll()
        {
            return await restClient.AtUrl("Admin/UpgradeLogs/").Get<UpgradeLogs>();
        }

        /// <summary>
        /// Returns an upgradeLog for the given id.
        /// </summary>
        /// <param name="upgradeLogId"></param>
        /// <returns></returns>
        public async Task<RestResponse<UpgradeLog>> Get(string upgradeLogId)
        {
             var urlTemplate = "Admin/UpgradeLogs/{0}";
             urlTemplate = string.Format(urlTemplate, upgradeLogId);
            return await restClient.AtUrl(urlTemplate).Get<UpgradeLog>();
        }

        /// <summary>
        /// Saves the given upgradeLog.
        /// </summary>
        /// <param name="upgradeLog"></param>
        /// <returns></returns>
        public async Task<RestResponse<UpgradeLog>> Create(UpgradeLog upgradeLog)
        {
            return await restClient.AtUrl("Admin/UpgradeLogs/").Post<UpgradeLog, UpgradeLog>(upgradeLog);
        }

        /// <summary>
        /// Updates the given upgradeLog.
        /// </summary>
        /// <param name="upgradeLog"></param>
        /// <returns></returns>
        public async Task<RestResponse<UpgradeLog>> Update(UpgradeLog upgradeLog)
        {
             var urlTemplate = "Admin/UpgradeLogs/{0}";
             urlTemplate = string.Format(urlTemplate, upgradeLog);
            return await restClient.AtUrl(urlTemplate).Put<UpgradeLog, UpgradeLog>(upgradeLog);
        }

    }
 

 
    /// 
    public class UpgradeLogsFacadeBatch
    {
        private IRestClient restClient;

        public UpgradeLogsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.UpgradeLogs";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "Admin/UpgradeLogs/";

            return bRequest;
        }

        /// <summary>
        /// Returns an upgradeLog for the given id.
        /// </summary>
        /// <param name="upgradeLogId"></param>
        /// <returns></returns>
        public Request Get(string upgradeLogId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.UpgradeLog";
            bRequest.Content = null;

            var urlTemplate = "Admin/UpgradeLogs/{0}";
            urlTemplate = string.Format(urlTemplate, upgradeLogId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Saves the given upgradeLog.
        /// </summary>
        /// <param name="upgradeLog"></param>
        /// <returns></returns>
        public Request Create(UpgradeLog upgradeLog, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.UpgradeLog";
            bRequest.Content = upgradeLog;

            bRequest.Uri = restClient.GetBaseUrl() + "Admin/UpgradeLogs/";

            return bRequest;
        }

        /// <summary>
        /// Updates the given upgradeLog.
        /// </summary>
        /// <param name="upgradeLog"></param>
        /// <returns></returns>
        public Request Update(UpgradeLog upgradeLog, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.UpgradeLog";
            bRequest.Content = upgradeLog;

            var urlTemplate = "Admin/UpgradeLogs/{0}";
            urlTemplate = string.Format(urlTemplate, upgradeLog);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class AccountsFacade
    {
        private IRestClient restClient;

        public AccountsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Create a credit card account, storing the card number. Will create and store a token if tokenization is enabled.
        /// </summary>
        /// <param name="request"></param>
        /// <param name="returnAccountIfAccountExists"></param>
        /// <returns></returns>
        public async Task<RestResponse<AccountResponse>> CreateCardNumberAccount(CreateCardNumberAccountRequest request, string returnAccountIfAccountExists = "null")
        {
            return await restClient.AtUrl("CRM/Accounts/CardNumber").Post<string, AccountResponse>(returnAccountIfAccountExists);
        }

        /// <summary>
        /// Create a credit card account from a Vantiv Encrypted Reader using tokenization.
        /// </summary>
        /// <param name="request"></param>
        /// <param name="returnAccountIfAccountExists"></param>
        /// <returns></returns>
        public async Task<RestResponse<AccountResponse>> CreateVantivEncryptedCardAccount(CreateVantivEncryptedCardAccountRequest request, string returnAccountIfAccountExists = "null")
        {
            return await restClient.AtUrl("CRM/Accounts/VantivEncryptedCard").Post<string, AccountResponse>(returnAccountIfAccountExists);
        }

        /// <summary>
        /// Store a direct debit account.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<AccountResponse>> CreateDirectDebitAccount(CreateDirectDebitAccountRequest request)
        {
            return await restClient.AtUrl("CRM/Accounts/DirectDebit").Post<CreateDirectDebitAccountRequest, AccountResponse>(request);
        }

        /// <summary>
        /// Store a SEPA Direct Debit account.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<AccountResponse>> CreateSepaAccount(CreateSepaAccountRequest request)
        {
            return await restClient.AtUrl("CRM/Accounts/SEPA").Post<CreateSepaAccountRequest, AccountResponse>(request);
        }

        /// <summary>
        /// Removes an account.
        /// </summary>
        /// <param name="accountId"></param>
        /// <param name="transactionOrigin"></param>
        /// <param name="overrideDeleteProtection"></param>
        public async Task<RestResponse<NoResponse>> DeleteAccount(Int32 accountId, string transactionOrigin, Boolean overrideDeleteProtection = false)
        {
             var urlTemplate = "CRM/Accounts/{0}?transactionOrigin={1}&overrideDeleteProtection={2}";
             urlTemplate = string.Format(urlTemplate, accountId, transactionOrigin, overrideDeleteProtection);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Get details of all the credit card accounts for the specified constituent id and all its visible affiliation's accounts as well.
        /// To exclude accounts of the visible affiliations pass includeAffiliations=\"false\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeInactive"></param>
        /// <param name="includeAffiliates"></param>
        /// <returns></returns>
        public async Task<RestResponse<AccountsResponse>> GetAll(string constituentId, string includeInactive, string includeAffiliates)
        {
            var urlTemplate = "CRM/Accounts/?constituentId={0}&includeInactive={1}&includeAffiliates={2}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeInactive,includeAffiliates);
            return await restClient.AtUrl(urlTemplate).Get<AccountsResponse>();
        }

        /// <summary>
        /// Get details of a specific credit card account
        /// </summary>
        /// <param name="accountId"></param>
        /// <returns></returns>
        public async Task<RestResponse<AccountResponse>> Get(string accountId)
        {
             var urlTemplate = "CRM/Accounts/{0}";
             urlTemplate = string.Format(urlTemplate, accountId);
            return await restClient.AtUrl(urlTemplate).Get<AccountResponse>();
        }

        /// <summary>
        /// Update expiration date or name on a credit card account or token. Will also tokenize the credit card if tokenization is enabled.
        /// </summary>
        /// <param name="accountId"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<AccountResponse>> UpdateCardNumberAccount(Int32 accountId, UpdateCardNumberAccountRequest request)
        {
             var urlTemplate = "CRM/Accounts/{0}/CardNumber";
             urlTemplate = string.Format(urlTemplate, accountId);
            return await restClient.AtUrl(urlTemplate).Put<UpdateCardNumberAccountRequest, AccountResponse>(request);
        }

        /// <summary>
        /// Updates expiration date or name on a direct debit account.
        /// </summary>
        /// <param name="accountId"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<AccountResponse>> UpdateDirectDebitAccount(Int32 accountId, UpdateDirectDebitAccountRequest request)
        {
             var urlTemplate = "CRM/Accounts/{0}/DirectDebit";
             urlTemplate = string.Format(urlTemplate, accountId);
            return await restClient.AtUrl(urlTemplate).Put<UpdateDirectDebitAccountRequest, AccountResponse>(request);
        }

        /// <summary>
        /// Updates information on a SEPA Direct Debit Account.
        /// </summary>
        /// <param name="accountId"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<AccountResponse>> UpdateSepaAccount(Int32 accountId, UpdateSepaAccountRequest request)
        {
             var urlTemplate = "CRM/Accounts/{0}/SEPA";
             urlTemplate = string.Format(urlTemplate, accountId);
            return await restClient.AtUrl(urlTemplate).Put<UpdateSepaAccountRequest, AccountResponse>(request);
        }

    }
 

 
    /// 
    public class AccountsFacadeBatch
    {
        private IRestClient restClient;

        public AccountsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Create a credit card account, storing the card number. Will create and store a token if tokenization is enabled.
        /// </summary>
        /// <param name="request"></param>
        /// <param name="returnAccountIfAccountExists"></param>
        /// <returns></returns>
        public Request CreateCardNumberAccount(CreateCardNumberAccountRequest request, string returnAccountIfAccountExists = "null", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AccountResponse";
            bRequest.Content = returnAccountIfAccountExists;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/Accounts/CardNumber";

            return bRequest;
        }

        /// <summary>
        /// Create a credit card account from a Vantiv Encrypted Reader using tokenization.
        /// </summary>
        /// <param name="request"></param>
        /// <param name="returnAccountIfAccountExists"></param>
        /// <returns></returns>
        public Request CreateVantivEncryptedCardAccount(CreateVantivEncryptedCardAccountRequest request, string returnAccountIfAccountExists = "null", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AccountResponse";
            bRequest.Content = returnAccountIfAccountExists;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/Accounts/VantivEncryptedCard";

            return bRequest;
        }

        /// <summary>
        /// Store a direct debit account.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request CreateDirectDebitAccount(CreateDirectDebitAccountRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AccountResponse";
            bRequest.Content = request;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/Accounts/DirectDebit";

            return bRequest;
        }

        /// <summary>
        /// Store a SEPA Direct Debit account.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request CreateSepaAccount(CreateSepaAccountRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AccountResponse";
            bRequest.Content = request;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/Accounts/SEPA";

            return bRequest;
        }

        /// <summary>
        /// Removes an account.
        /// </summary>
        /// <param name="accountId"></param>
        /// <param name="transactionOrigin"></param>
        /// <param name="overrideDeleteProtection"></param>
        public Request DeleteAccount(Int32 accountId, string transactionOrigin, Boolean overrideDeleteProtection = false, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "CRM/Accounts/{0}?transactionOrigin={1}&overrideDeleteProtection={2}";
            urlTemplate = string.Format(urlTemplate, accountId, transactionOrigin, overrideDeleteProtection);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of all the credit card accounts for the specified constituent id and all its visible affiliation's accounts as well.
        /// To exclude accounts of the visible affiliations pass includeAffiliations=\"false\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeInactive"></param>
        /// <param name="includeAffiliates"></param>
        /// <returns></returns>
        public Request GetAll(string constituentId, string includeInactive, string includeAffiliates, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AccountsResponse";
            bRequest.Content = null;

            var urlTemplate = "CRM/Accounts/?constituentId={0}&includeInactive={1}&includeAffiliates={2}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeInactive,includeAffiliates);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a specific credit card account
        /// </summary>
        /// <param name="accountId"></param>
        /// <returns></returns>
        public Request Get(string accountId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AccountResponse";
            bRequest.Content = null;

            var urlTemplate = "CRM/Accounts/{0}";
            urlTemplate = string.Format(urlTemplate, accountId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Update expiration date or name on a credit card account or token. Will also tokenize the credit card if tokenization is enabled.
        /// </summary>
        /// <param name="accountId"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request UpdateCardNumberAccount(Int32 accountId, UpdateCardNumberAccountRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AccountResponse";
            bRequest.Content = request;

            var urlTemplate = "CRM/Accounts/{0}/CardNumber";
            urlTemplate = string.Format(urlTemplate, accountId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Updates expiration date or name on a direct debit account.
        /// </summary>
        /// <param name="accountId"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request UpdateDirectDebitAccount(Int32 accountId, UpdateDirectDebitAccountRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AccountResponse";
            bRequest.Content = request;

            var urlTemplate = "CRM/Accounts/{0}/DirectDebit";
            urlTemplate = string.Format(urlTemplate, accountId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Updates information on a SEPA Direct Debit Account.
        /// </summary>
        /// <param name="accountId"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request UpdateSepaAccount(Int32 accountId, UpdateSepaAccountRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AccountResponse";
            bRequest.Content = request;

            var urlTemplate = "CRM/Accounts/{0}/SEPA";
            urlTemplate = string.Format(urlTemplate, accountId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ActionsFacade
    {
        private IRestClient restClient;

        public ActionsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the actions for the given constituent or issue.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="issueId"></param>
        /// <returns></returns>
        public async Task<RestResponse<IssueActions>> GetAll(string constituentId = "", string issueId = "")
        {
            var urlTemplate = "CRM/Actions/?constituentId={0}&issueId={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,issueId);
            return await restClient.AtUrl(urlTemplate).Get<IssueActions>();
        }

        /// <summary>
        /// Get details of an issue action.
        /// </summary>
        /// <param name="issueActionId"></param>
        /// <returns></returns>
        public async Task<RestResponse<IssueAction>> Get(string issueActionId = "")
        {
             var urlTemplate = "CRM/Actions/{0}";
             urlTemplate = string.Format(urlTemplate, issueActionId);
            return await restClient.AtUrl(urlTemplate).Get<IssueAction>();
        }

        /// <summary>
        /// Create an issue action for a Constituent
        /// </summary>
        /// <param name="issueAction"></param>
        /// <returns></returns>
        public async Task<RestResponse<IssueAction>> Create(IssueAction issueAction)
        {
            return await restClient.AtUrl("CRM/Actions/").Post<IssueAction, IssueAction>(issueAction);
        }

        /// <summary>
        /// Update an issue action for a Constituent
        /// </summary>
        /// <param name="actionId"></param>
        /// <param name="issueAction"></param>
        /// <returns></returns>
        public async Task<RestResponse<IssueAction>> Update(string actionId, IssueAction issueAction)
        {
             var urlTemplate = "CRM/Actions/{0}";
             urlTemplate = string.Format(urlTemplate, actionId);
            return await restClient.AtUrl(urlTemplate).Put<IssueAction, IssueAction>(issueAction);
        }

        /// <summary>
        /// Delete an issue action.
        /// </summary>
        /// <param name="actionId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string actionId)
        {
             var urlTemplate = "CRM/Actions/{0}";
             urlTemplate = string.Format(urlTemplate, actionId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ActionsFacadeBatch
    {
        private IRestClient restClient;

        public ActionsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the actions for the given constituent or issue.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="issueId"></param>
        /// <returns></returns>
        public Request GetAll(string constituentId = "", string issueId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.IssueActions";
            bRequest.Content = null;

            var urlTemplate = "CRM/Actions/?constituentId={0}&issueId={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,issueId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of an issue action.
        /// </summary>
        /// <param name="issueActionId"></param>
        /// <returns></returns>
        public Request Get(string issueActionId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.IssueAction";
            bRequest.Content = null;

            var urlTemplate = "CRM/Actions/{0}";
            urlTemplate = string.Format(urlTemplate, issueActionId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create an issue action for a Constituent
        /// </summary>
        /// <param name="issueAction"></param>
        /// <returns></returns>
        public Request Create(IssueAction issueAction, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.IssueAction";
            bRequest.Content = issueAction;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/Actions/";

            return bRequest;
        }

        /// <summary>
        /// Update an issue action for a Constituent
        /// </summary>
        /// <param name="actionId"></param>
        /// <param name="issueAction"></param>
        /// <returns></returns>
        public Request Update(string actionId, IssueAction issueAction, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.IssueAction";
            bRequest.Content = issueAction;

            var urlTemplate = "CRM/Actions/{0}";
            urlTemplate = string.Format(urlTemplate, actionId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an issue action.
        /// </summary>
        /// <param name="actionId"></param>
        public Request Delete(string actionId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "CRM/Actions/{0}";
            urlTemplate = string.Format(urlTemplate, actionId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class AddressesFacade
    {
        private IRestClient restClient;

        public AddressesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the addresses for the specified constituent id and all its visible affiliation's addresses as well. To exclude addresses of the visible affiliations pass includeAffiliations=\"false\". To get only the primary addresses, pass primaryOnly=\"true\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <param name="primaryOnly"></param>
        /// <param name="includeFromAffiliations"></param>
        /// <returns></returns>
        public async Task<RestResponse<Addresses>> GetAll(string constituentId = "", string includeAffiliations = "", string primaryOnly = "", string includeFromAffiliations = "")
        {
            var urlTemplate = "CRM/Addresses/?constituentId={0}&includeAffiliations={1}&primaryOnly={2}&includeFromAffiliations={3}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations,primaryOnly,includeFromAffiliations);
            return await restClient.AtUrl(urlTemplate).Get<Addresses>();
        }

        /// <summary>
        /// Get details of an address using addressId as a URL query parameter. Returns 404 Not Found if an address with the specified Id is not found.
        /// </summary>
        /// <param name="addressId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Address>> Get(string addressId = "")
        {
             var urlTemplate = "CRM/Addresses/{0}";
             urlTemplate = string.Format(urlTemplate, addressId);
            return await restClient.AtUrl(urlTemplate).Get<Address>();
        }

        /// <summary>
        /// Create a new address for a Constituent by sending an XML or JSON representation of an Address object using HTTP POST.
        /// </summary>
        /// <param name="address"></param>
        /// <returns></returns>
        public async Task<RestResponse<Address>> Create(Address address)
        {
            return await restClient.AtUrl("CRM/Addresses/").Post<Address, Address>(address);
        }

        /// <summary>
        /// Update an address for a Constituent by sending an XML or JSON representation of an existing Address object using HTTP PUT.
        /// </summary>
        /// <param name="addressId"></param>
        /// <param name="address"></param>
        /// <returns></returns>
        public async Task<RestResponse<Address>> Update(string addressId, Address address)
        {
             var urlTemplate = "CRM/Addresses/{0}";
             urlTemplate = string.Format(urlTemplate, addressId);
            return await restClient.AtUrl(urlTemplate).Put<Address, Address>(address);
        }

        /// <summary>
        /// Delete an address along with all the phones attached to the address. Primary address for a Constituent cannot be deleted.
        /// </summary>
        /// <param name="addressId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string addressId)
        {
             var urlTemplate = "CRM/Addresses/{0}";
             urlTemplate = string.Format(urlTemplate, addressId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class AddressesFacadeBatch
    {
        private IRestClient restClient;

        public AddressesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the addresses for the specified constituent id and all its visible affiliation's addresses as well. To exclude addresses of the visible affiliations pass includeAffiliations=\"false\". To get only the primary addresses, pass primaryOnly=\"true\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <param name="primaryOnly"></param>
        /// <param name="includeFromAffiliations"></param>
        /// <returns></returns>
        public Request GetAll(string constituentId = "", string includeAffiliations = "", string primaryOnly = "", string includeFromAffiliations = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Addresses";
            bRequest.Content = null;

            var urlTemplate = "CRM/Addresses/?constituentId={0}&includeAffiliations={1}&primaryOnly={2}&includeFromAffiliations={3}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations,primaryOnly,includeFromAffiliations);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of an address using addressId as a URL query parameter. Returns 404 Not Found if an address with the specified Id is not found.
        /// </summary>
        /// <param name="addressId"></param>
        /// <returns></returns>
        public Request Get(string addressId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Address";
            bRequest.Content = null;

            var urlTemplate = "CRM/Addresses/{0}";
            urlTemplate = string.Format(urlTemplate, addressId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new address for a Constituent by sending an XML or JSON representation of an Address object using HTTP POST.
        /// </summary>
        /// <param name="address"></param>
        /// <returns></returns>
        public Request Create(Address address, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Address";
            bRequest.Content = address;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/Addresses/";

            return bRequest;
        }

        /// <summary>
        /// Update an address for a Constituent by sending an XML or JSON representation of an existing Address object using HTTP PUT.
        /// </summary>
        /// <param name="addressId"></param>
        /// <param name="address"></param>
        /// <returns></returns>
        public Request Update(string addressId, Address address, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Address";
            bRequest.Content = address;

            var urlTemplate = "CRM/Addresses/{0}";
            urlTemplate = string.Format(urlTemplate, addressId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an address along with all the phones attached to the address. Primary address for a Constituent cannot be deleted.
        /// </summary>
        /// <param name="addressId"></param>
        public Request Delete(string addressId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "CRM/Addresses/{0}";
            urlTemplate = string.Format(urlTemplate, addressId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class AffiliationInfoFacade
    {
        private IRestClient restClient;

        public AffiliationInfoFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Create affiliation between a group constituent and its related constituent. If the related constituent does not exist then create the related constituent as well before creating the affiliation.
        /// </summary>
        /// <param name="affiliationInfo"></param>
        /// <returns></returns>
        public async Task<RestResponse<AffiliationInfo>> PostAffiliation(AffiliationInfo affiliationInfo)
        {
            return await restClient.AtUrl("CRM/AffiliationInfo/").Post<AffiliationInfo, AffiliationInfo>(affiliationInfo);
        }

    }
 

 
    /// 
    public class AffiliationInfoFacadeBatch
    {
        private IRestClient restClient;

        public AffiliationInfoFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Create affiliation between a group constituent and its related constituent. If the related constituent does not exist then create the related constituent as well before creating the affiliation.
        /// </summary>
        /// <param name="affiliationInfo"></param>
        /// <returns></returns>
        public Request PostAffiliation(AffiliationInfo affiliationInfo, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AffiliationInfo";
            bRequest.Content = affiliationInfo;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/AffiliationInfo/";

            return bRequest;
        }

    }
 

 
    /// 
    public class AffiliationsFacade
    {
        private IRestClient restClient;

        public AffiliationsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the affiliation of the specified indiviudal constituent id or get all the affiliations of the specified group constituent id. If both individual constituent id and group constituent id are specified get all the affiliations between them. To filter the affiliations that are active within certain date then pass values for start date and end date.To fetch primary affiliations alone pass primaryOnly=\"true\".
        /// </summary>
        /// <param name="individualConstituentId"></param>
        /// <param name="groupConstituentId"></param>
        /// <param name="startActiveDate"></param>
        /// <param name="endActiveDate"></param>
        /// <param name="primaryOnly"></param>
        /// <returns></returns>
        public async Task<RestResponse<Affiliations>> GetAll(string individualConstituentId = "", string groupConstituentId = "", string startActiveDate = "", string endActiveDate = "", string primaryOnly = "")
        {
            var urlTemplate = "CRM/Affiliations/?individualConstituentId={0}&groupConstituentId={1}&startActiveDate={2}&endActiveDate={3}&primaryOnly={4}";
            urlTemplate = string.Format(urlTemplate, individualConstituentId,groupConstituentId,startActiveDate,endActiveDate,primaryOnly);
            return await restClient.AtUrl(urlTemplate).Get<Affiliations>();
        }

        /// <summary>
        /// Get details of an affiliation.
        /// </summary>
        /// <param name="affiliationId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Affiliation>> Get(string affiliationId = "")
        {
             var urlTemplate = "CRM/Affiliations/{0}";
             urlTemplate = string.Format(urlTemplate, affiliationId);
            return await restClient.AtUrl(urlTemplate).Get<Affiliation>();
        }

        /// <summary>
        /// Create a new affiliation.
        /// </summary>
        /// <param name="affiliation"></param>
        /// <returns></returns>
        public async Task<RestResponse<Affiliation>> Create(Affiliation affiliation)
        {
            return await restClient.AtUrl("CRM/Affiliations/").Post<Affiliation, Affiliation>(affiliation);
        }

        /// <summary>
        /// Update an affiliation.
        /// </summary>
        /// <param name="affiliationId"></param>
        /// <param name="affiliation"></param>
        /// <returns></returns>
        public async Task<RestResponse<Affiliation>> Update(string affiliationId, Affiliation affiliation)
        {
             var urlTemplate = "CRM/Affiliations/{0}";
             urlTemplate = string.Format(urlTemplate, affiliationId);
            return await restClient.AtUrl(urlTemplate).Put<Affiliation, Affiliation>(affiliation);
        }

        /// <summary>
        /// Delete an affiliation.
        /// </summary>
        /// <param name="affiliationId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string affiliationId)
        {
             var urlTemplate = "CRM/Affiliations/{0}";
             urlTemplate = string.Format(urlTemplate, affiliationId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class AffiliationsFacadeBatch
    {
        private IRestClient restClient;

        public AffiliationsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the affiliation of the specified indiviudal constituent id or get all the affiliations of the specified group constituent id. If both individual constituent id and group constituent id are specified get all the affiliations between them. To filter the affiliations that are active within certain date then pass values for start date and end date.To fetch primary affiliations alone pass primaryOnly=\"true\".
        /// </summary>
        /// <param name="individualConstituentId"></param>
        /// <param name="groupConstituentId"></param>
        /// <param name="startActiveDate"></param>
        /// <param name="endActiveDate"></param>
        /// <param name="primaryOnly"></param>
        /// <returns></returns>
        public Request GetAll(string individualConstituentId = "", string groupConstituentId = "", string startActiveDate = "", string endActiveDate = "", string primaryOnly = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Affiliations";
            bRequest.Content = null;

            var urlTemplate = "CRM/Affiliations/?individualConstituentId={0}&groupConstituentId={1}&startActiveDate={2}&endActiveDate={3}&primaryOnly={4}";
            urlTemplate = string.Format(urlTemplate, individualConstituentId,groupConstituentId,startActiveDate,endActiveDate,primaryOnly);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of an affiliation.
        /// </summary>
        /// <param name="affiliationId"></param>
        /// <returns></returns>
        public Request Get(string affiliationId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Affiliation";
            bRequest.Content = null;

            var urlTemplate = "CRM/Affiliations/{0}";
            urlTemplate = string.Format(urlTemplate, affiliationId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new affiliation.
        /// </summary>
        /// <param name="affiliation"></param>
        /// <returns></returns>
        public Request Create(Affiliation affiliation, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Affiliation";
            bRequest.Content = affiliation;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/Affiliations/";

            return bRequest;
        }

        /// <summary>
        /// Update an affiliation.
        /// </summary>
        /// <param name="affiliationId"></param>
        /// <param name="affiliation"></param>
        /// <returns></returns>
        public Request Update(string affiliationId, Affiliation affiliation, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Affiliation";
            bRequest.Content = affiliation;

            var urlTemplate = "CRM/Affiliations/{0}";
            urlTemplate = string.Format(urlTemplate, affiliationId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an affiliation.
        /// </summary>
        /// <param name="affiliationId"></param>
        public Request Delete(string affiliationId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "CRM/Affiliations/{0}";
            urlTemplate = string.Format(urlTemplate, affiliationId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class AliasesFacade
    {
        private IRestClient restClient;

        public AliasesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the aliases for the specified constituent id and all its visible affiliation's aliases as well. To exclude aliases of the visible affiliations pass includeAffiliations=\"false\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public async Task<RestResponse<Aliases>> GetAll(string constituentId = "", string includeAffiliations = "")
        {
            var urlTemplate = "CRM/Aliases/?constituentId={0}&includeAffiliations={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations);
            return await restClient.AtUrl(urlTemplate).Get<Aliases>();
        }

        /// <summary>
        /// Get details of an alias.
        /// </summary>
        /// <param name="aliasId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Alias>> Get(string aliasId = "")
        {
             var urlTemplate = "CRM/Aliases/{0}";
             urlTemplate = string.Format(urlTemplate, aliasId);
            return await restClient.AtUrl(urlTemplate).Get<Alias>();
        }

        /// <summary>
        /// Create a new alias.
        /// </summary>
        /// <param name="alias"></param>
        /// <returns></returns>
        public async Task<RestResponse<Alias>> Create(Alias alias)
        {
            return await restClient.AtUrl("CRM/Aliases/").Post<Alias, Alias>(alias);
        }

        /// <summary>
        /// Update an alias.
        /// </summary>
        /// <param name="aliasId"></param>
        /// <param name="alias"></param>
        /// <returns></returns>
        public async Task<RestResponse<Alias>> Update(string aliasId, Alias alias)
        {
             var urlTemplate = "CRM/Aliases/{0}";
             urlTemplate = string.Format(urlTemplate, aliasId);
            return await restClient.AtUrl(urlTemplate).Put<Alias, Alias>(alias);
        }

        /// <summary>
        /// Delete an alias.
        /// </summary>
        /// <param name="aliasId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string aliasId)
        {
             var urlTemplate = "CRM/Aliases/{0}";
             urlTemplate = string.Format(urlTemplate, aliasId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class AliasesFacadeBatch
    {
        private IRestClient restClient;

        public AliasesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the aliases for the specified constituent id and all its visible affiliation's aliases as well. To exclude aliases of the visible affiliations pass includeAffiliations=\"false\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public Request GetAll(string constituentId = "", string includeAffiliations = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Aliases";
            bRequest.Content = null;

            var urlTemplate = "CRM/Aliases/?constituentId={0}&includeAffiliations={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of an alias.
        /// </summary>
        /// <param name="aliasId"></param>
        /// <returns></returns>
        public Request Get(string aliasId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Alias";
            bRequest.Content = null;

            var urlTemplate = "CRM/Aliases/{0}";
            urlTemplate = string.Format(urlTemplate, aliasId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new alias.
        /// </summary>
        /// <param name="alias"></param>
        /// <returns></returns>
        public Request Create(Alias alias, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Alias";
            bRequest.Content = alias;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/Aliases/";

            return bRequest;
        }

        /// <summary>
        /// Update an alias.
        /// </summary>
        /// <param name="aliasId"></param>
        /// <param name="alias"></param>
        /// <returns></returns>
        public Request Update(string aliasId, Alias alias, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Alias";
            bRequest.Content = alias;

            var urlTemplate = "CRM/Aliases/{0}";
            urlTemplate = string.Format(urlTemplate, aliasId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an alias.
        /// </summary>
        /// <param name="aliasId"></param>
        public Request Delete(string aliasId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "CRM/Aliases/{0}";
            urlTemplate = string.Format(urlTemplate, aliasId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class AssociationsFacade
    {
        private IRestClient restClient;

        public AssociationsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the association of the specified constituent id or get all the associations of the specified associated constituent id. If both constituent id and associated constituent id are specified get all the associations between them. To filter the associations that are active within certain date then pass values for start date and end date.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="associatedConstituentId"></param>
        /// <param name="startActiveDate"></param>
        /// <param name="endActiveDate"></param>
        /// <returns></returns>
        public async Task<RestResponse<Associations>> GetAll(string constituentId = "", string associatedConstituentId = "", string startActiveDate = "", string endActiveDate = "")
        {
            var urlTemplate = "CRM/Associations/?constituentId={0}&associatedConstituentId={1}&startActiveDate={2}&endActiveDate={3}";
            urlTemplate = string.Format(urlTemplate, constituentId,associatedConstituentId,startActiveDate,endActiveDate);
            return await restClient.AtUrl(urlTemplate).Get<Associations>();
        }

        /// <summary>
        /// Get details of an association.
        /// </summary>
        /// <param name="associationId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Association>> Get(string associationId = "")
        {
             var urlTemplate = "CRM/Associations/{0}";
             urlTemplate = string.Format(urlTemplate, associationId);
            return await restClient.AtUrl(urlTemplate).Get<Association>();
        }

        /// <summary>
        /// Create a new association.
        /// </summary>
        /// <param name="association"></param>
        /// <returns></returns>
        public async Task<RestResponse<Association>> Create(Association association)
        {
            return await restClient.AtUrl("CRM/Associations/").Post<Association, Association>(association);
        }

        /// <summary>
        /// Update a association.
        /// </summary>
        /// <param name="associationId"></param>
        /// <param name="association"></param>
        /// <returns></returns>
        public async Task<RestResponse<Association>> Update(string associationId, Association association)
        {
             var urlTemplate = "CRM/Associations/{0}";
             urlTemplate = string.Format(urlTemplate, associationId);
            return await restClient.AtUrl(urlTemplate).Put<Association, Association>(association);
        }

        /// <summary>
        /// Delete a association.
        /// </summary>
        /// <param name="associationId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string associationId)
        {
             var urlTemplate = "CRM/Associations/{0}";
             urlTemplate = string.Format(urlTemplate, associationId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class AssociationsFacadeBatch
    {
        private IRestClient restClient;

        public AssociationsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the association of the specified constituent id or get all the associations of the specified associated constituent id. If both constituent id and associated constituent id are specified get all the associations between them. To filter the associations that are active within certain date then pass values for start date and end date.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="associatedConstituentId"></param>
        /// <param name="startActiveDate"></param>
        /// <param name="endActiveDate"></param>
        /// <returns></returns>
        public Request GetAll(string constituentId = "", string associatedConstituentId = "", string startActiveDate = "", string endActiveDate = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Associations";
            bRequest.Content = null;

            var urlTemplate = "CRM/Associations/?constituentId={0}&associatedConstituentId={1}&startActiveDate={2}&endActiveDate={3}";
            urlTemplate = string.Format(urlTemplate, constituentId,associatedConstituentId,startActiveDate,endActiveDate);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of an association.
        /// </summary>
        /// <param name="associationId"></param>
        /// <returns></returns>
        public Request Get(string associationId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Association";
            bRequest.Content = null;

            var urlTemplate = "CRM/Associations/{0}";
            urlTemplate = string.Format(urlTemplate, associationId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new association.
        /// </summary>
        /// <param name="association"></param>
        /// <returns></returns>
        public Request Create(Association association, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Association";
            bRequest.Content = association;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/Associations/";

            return bRequest;
        }

        /// <summary>
        /// Update a association.
        /// </summary>
        /// <param name="associationId"></param>
        /// <param name="association"></param>
        /// <returns></returns>
        public Request Update(string associationId, Association association, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Association";
            bRequest.Content = association;

            var urlTemplate = "CRM/Associations/{0}";
            urlTemplate = string.Format(urlTemplate, associationId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete a association.
        /// </summary>
        /// <param name="associationId"></param>
        public Request Delete(string associationId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "CRM/Associations/{0}";
            urlTemplate = string.Format(urlTemplate, associationId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class AttendanceHistoryFacade
    {
        private IRestClient restClient;

        public AttendanceHistoryFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Attendance History for a selected constituent optionally including primary affiliates.  Does not return history based on recipient for the selected constituent(s).
        /// </summary>
        /// <returns></returns>
        public async Task<RestResponse<AttendanceHistories>> GetAll(string constituentId = "", string includeAffiliations = "")
        {
            var urlTemplate = "CRM/AttendanceHistory/?constituentId={0}&includeAffiliations={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations);
            return await restClient.AtUrl(urlTemplate).Get<AttendanceHistories>();
        }

    }
 

 
    /// 
    public class AttendanceHistoryFacadeBatch
    {
        private IRestClient restClient;

        public AttendanceHistoryFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Attendance History for a selected constituent optionally including primary affiliates.  Does not return history based on recipient for the selected constituent(s).
        /// </summary>
        /// <returns></returns>
        public Request GetAll(string constituentId = "", string includeAffiliations = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AttendanceHistories";
            bRequest.Content = null;

            var urlTemplate = "CRM/AttendanceHistory/?constituentId={0}&includeAffiliations={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class AttributesFacade
    {
        private IRestClient restClient;

        public AttributesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the attributes for the specified constituent id and all its visible affiliation's attributes as well. To exclude attributes of the visible affiliations pass includeAffiliations=\"false\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public async Task<RestResponse<Attributes>> GetAll(string constituentId = "", string includeAffiliations = "")
        {
            var urlTemplate = "CRM/Attributes/?constituentId={0}&includeAffiliations={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations);
            return await restClient.AtUrl(urlTemplate).Get<Attributes>();
        }

        /// <summary>
        /// Get details of an attribute.
        /// </summary>
        /// <param name="attributeId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Tessitura.Service.Contract.Attribute>> Get(string attributeId = "")
        {
             var urlTemplate = "CRM/Attributes/{0}";
             urlTemplate = string.Format(urlTemplate, attributeId);
            return await restClient.AtUrl(urlTemplate).Get<Tessitura.Service.Contract.Attribute>();
        }

        /// <summary>
        /// Create a new attribute.
        /// </summary>
        /// <param name="attribute"></param>
        /// <returns></returns>
        public async Task<RestResponse<Tessitura.Service.Contract.Attribute>> Create(Tessitura.Service.Contract.Attribute attribute)
        {
            return await restClient.AtUrl("CRM/Attributes/").Post<Tessitura.Service.Contract.Attribute, Tessitura.Service.Contract.Attribute>(attribute);
        }

        /// <summary>
        /// Update an attribute.
        /// </summary>
        /// <param name="attributeId"></param>
        /// <param name="attribute"></param>
        /// <returns></returns>
        public async Task<RestResponse<Tessitura.Service.Contract.Attribute>> Update(string attributeId, Tessitura.Service.Contract.Attribute attribute)
        {
             var urlTemplate = "CRM/Attributes/{0}";
             urlTemplate = string.Format(urlTemplate, attributeId);
            return await restClient.AtUrl(urlTemplate).Put<Tessitura.Service.Contract.Attribute, Tessitura.Service.Contract.Attribute>(attribute);
        }

        /// <summary>
        /// Delete an attribute.
        /// </summary>
        /// <param name="attributeId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string attributeId)
        {
             var urlTemplate = "CRM/Attributes/{0}";
             urlTemplate = string.Format(urlTemplate, attributeId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class AttributesFacadeBatch
    {
        private IRestClient restClient;

        public AttributesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the attributes for the specified constituent id and all its visible affiliation's attributes as well. To exclude attributes of the visible affiliations pass includeAffiliations=\"false\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public Request GetAll(string constituentId = "", string includeAffiliations = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Attributes";
            bRequest.Content = null;

            var urlTemplate = "CRM/Attributes/?constituentId={0}&includeAffiliations={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of an attribute.
        /// </summary>
        /// <param name="attributeId"></param>
        /// <returns></returns>
        public Request Get(string attributeId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Attribute";
            bRequest.Content = null;

            var urlTemplate = "CRM/Attributes/{0}";
            urlTemplate = string.Format(urlTemplate, attributeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new attribute.
        /// </summary>
        /// <param name="attribute"></param>
        /// <returns></returns>
        public Request Create(Tessitura.Service.Contract.Attribute attribute, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Attribute";
            bRequest.Content = attribute;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/Attributes/";

            return bRequest;
        }

        /// <summary>
        /// Update an attribute.
        /// </summary>
        /// <param name="attributeId"></param>
        /// <param name="attribute"></param>
        /// <returns></returns>
        public Request Update(string attributeId, Tessitura.Service.Contract.Attribute attribute, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Attribute";
            bRequest.Content = attribute;

            var urlTemplate = "CRM/Attributes/{0}";
            urlTemplate = string.Format(urlTemplate, attributeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an attribute.
        /// </summary>
        /// <param name="attributeId"></param>
        public Request Delete(string attributeId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "CRM/Attributes/{0}";
            urlTemplate = string.Format(urlTemplate, attributeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ConstituenciesFacade
    {
        private IRestClient restClient;

        public ConstituenciesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the constituencies for the specified constituent id and all its visible affiliation's constituencies as well. To exclude constituencies of the visible affiliations pass includeAffiliations=\"false\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public async Task<RestResponse<Constituencies>> GetAll(string constituentId = "", string includeAffiliations = "")
        {
            var urlTemplate = "CRM/Constituencies/?constituentId={0}&includeAffiliations={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations);
            return await restClient.AtUrl(urlTemplate).Get<Constituencies>();
        }

        /// <summary>
        /// Get details of constituency.
        /// </summary>
        /// <param name="constituencyId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Constituency>> Get(string constituencyId = "")
        {
             var urlTemplate = "CRM/Constituencies/{0}";
             urlTemplate = string.Format(urlTemplate, constituencyId);
            return await restClient.AtUrl(urlTemplate).Get<Constituency>();
        }

        /// <summary>
        /// Create a new constituency.
        /// </summary>
        /// <param name="constituency"></param>
        /// <returns></returns>
        public async Task<RestResponse<Constituency>> Create(Constituency constituency)
        {
            return await restClient.AtUrl("CRM/Constituencies/").Post<Constituency, Constituency>(constituency);
        }

        /// <summary>
        /// Update a constituency.
        /// </summary>
        /// <param name="constituencyId"></param>
        /// <param name="constituency"></param>
        /// <returns></returns>
        public async Task<RestResponse<Constituency>> Update(string constituencyId, Constituency constituency)
        {
             var urlTemplate = "CRM/Constituencies/{0}";
             urlTemplate = string.Format(urlTemplate, constituencyId);
            return await restClient.AtUrl(urlTemplate).Put<Constituency, Constituency>(constituency);
        }

        /// <summary>
        /// Delete a constituency.
        /// </summary>
        /// <param name="constituencyId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string constituencyId)
        {
             var urlTemplate = "CRM/Constituencies/{0}";
             urlTemplate = string.Format(urlTemplate, constituencyId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ConstituenciesFacadeBatch
    {
        private IRestClient restClient;

        public ConstituenciesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the constituencies for the specified constituent id and all its visible affiliation's constituencies as well. To exclude constituencies of the visible affiliations pass includeAffiliations=\"false\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public Request GetAll(string constituentId = "", string includeAffiliations = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Constituencies";
            bRequest.Content = null;

            var urlTemplate = "CRM/Constituencies/?constituentId={0}&includeAffiliations={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of constituency.
        /// </summary>
        /// <param name="constituencyId"></param>
        /// <returns></returns>
        public Request Get(string constituencyId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Constituency";
            bRequest.Content = null;

            var urlTemplate = "CRM/Constituencies/{0}";
            urlTemplate = string.Format(urlTemplate, constituencyId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new constituency.
        /// </summary>
        /// <param name="constituency"></param>
        /// <returns></returns>
        public Request Create(Constituency constituency, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Constituency";
            bRequest.Content = constituency;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/Constituencies/";

            return bRequest;
        }

        /// <summary>
        /// Update a constituency.
        /// </summary>
        /// <param name="constituencyId"></param>
        /// <param name="constituency"></param>
        /// <returns></returns>
        public Request Update(string constituencyId, Constituency constituency, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Constituency";
            bRequest.Content = constituency;

            var urlTemplate = "CRM/Constituencies/{0}";
            urlTemplate = string.Format(urlTemplate, constituencyId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete a constituency.
        /// </summary>
        /// <param name="constituencyId"></param>
        public Request Delete(string constituencyId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "CRM/Constituencies/{0}";
            urlTemplate = string.Format(urlTemplate, constituencyId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ConstituentContributionsFacade
    {
        private IRestClient restClient;

        public ConstituentContributionsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get contributions for a constituent.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="campaignIds"></param>
        /// <param name="fundIds"></param>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentContributions>> GetContributions(string constituentId = "", string campaignIds = "", string fundIds = "", string startDate = "", string endDate = "", string includeAffiliations = "")
        {
            var urlTemplate = "CRM/Contributions/?constituentId={0}&campaignIds={1}&fundIds={2}&startDate={3}&endDate={4}&includeAffiliations={5}";
            urlTemplate = string.Format(urlTemplate, constituentId,campaignIds,fundIds,startDate,endDate,includeAffiliations);
            return await restClient.AtUrl(urlTemplate).Get<ConstituentContributions>();
        }

    }
 

 
    /// 
    public class ConstituentContributionsFacadeBatch
    {
        private IRestClient restClient;

        public ConstituentContributionsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get contributions for a constituent.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="campaignIds"></param>
        /// <param name="fundIds"></param>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public Request GetContributions(string constituentId = "", string campaignIds = "", string fundIds = "", string startDate = "", string endDate = "", string includeAffiliations = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentContributions";
            bRequest.Content = null;

            var urlTemplate = "CRM/Contributions/?constituentId={0}&campaignIds={1}&fundIds={2}&startDate={3}&endDate={4}&includeAffiliations={5}";
            urlTemplate = string.Format(urlTemplate, constituentId,campaignIds,fundIds,startDate,endDate,includeAffiliations);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ConstituentsFacade
    {
        private IRestClient restClient;

        public ConstituentsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get constituent details with addresses, electronicAddresses, salutations and phones. To exclude information about visible affiliations pass includeAffiliations=\"false\"
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentDetail>> GetConstituent(string constituentId = "", string includeAffiliations = "")
        {
             var urlTemplate = "CRM/Constituents/{0}/Detail?includeAffiliations={1}";
             urlTemplate = string.Format(urlTemplate, constituentId, includeAffiliations);
            return await restClient.AtUrl(urlTemplate).Get<ConstituentDetail>();
        }

        /// <summary>
        /// Create a new constituent with addresses, electronicAddresses, salutations and phones.
        /// </summary>
        /// <param name="constituent"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentDetail>> CreateConstituent(ConstituentDetail constituent)
        {
            return await restClient.AtUrl("CRM/Constituents/Detail/").Post<ConstituentDetail, ConstituentDetail>(constituent);
        }

        /// <summary>
        /// Get primary household constituent details for a provided constituentId.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentDetail>> GetPrimaryHousehold(string constituentId = "")
        {
            var urlTemplate = "CRM/Constituents/PrimaryHousehold/?constituentId={0}";
            urlTemplate = string.Format(urlTemplate, constituentId);
            return await restClient.AtUrl(urlTemplate).Get<ConstituentDetail>();
        }

        /// <summary>
        /// Get the details of a flex header for a constituent
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="headerId"></param>
        /// <returns></returns>
        public async Task<RestResponse<FlexHeader>> GetFlexHeader(Int32 constituentId, Int32 headerId)
        {
             var urlTemplate = "CRM/Constituents/{0}/Header/Flex/{1}";
             urlTemplate = string.Format(urlTemplate, constituentId, headerId);
            return await restClient.AtUrl(urlTemplate).Get<FlexHeader>();
        }

        /// <summary>
        /// Constituent search
        /// </summary>
        /// <param name="type">One of basic, advanced, attribute or fluent</param>
        /// <param name="q">Use for fluent search</param>
        /// <param name="constituentGroups">One of individuals,organizations,households or comma separated combination. Leave blank to include all.</param>
        /// <param name="dup"></param>
        /// <param name="includeAffiliates"></param>
        /// <param name="constituencyIds"></param>
        /// <param name="listId"></param>
        /// <param name="ln"></param>
        /// <param name="fn"></param>
        /// <param name="constituentId"></param>
        /// <param name="street"></param>
        /// <param name="post"></param>
        /// <param name="atype"></param>
        /// <param name="op"></param>
        /// <param name="value"></param>
        /// <param name="key"></param>
        /// <param name="page"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentSearchResponse>> Search(string type, string q = "null", string constituentGroups = "null", string dup = "null", string includeAffiliates = "null", string constituencyIds = "null", string listId = "null", string ln = "null", string fn = "null", string constituentId = "null", string street = "null", string post = "null", string atype = "null", string op = "null", string value = "null", string key = "null", string page = "null", string pageSize = "null")
        {
            var urlTemplate = "CRM/Constituents/Search?type={0}&q={1}&constituentGroups={2}&dup={3}&includeAffiliates={4}&constituencyIds={5}&listId={6}&ln={7}&fn={8}&constituentId={9}&street={10}&post={11}&atype={12}&op={13}&value={14}&key={15}&page={16}&pageSize={17}";
            urlTemplate = string.Format(urlTemplate, type,q,constituentGroups,dup,includeAffiliates,constituencyIds,listId,ln,fn,constituentId,street,post,atype,op,value,key,page,pageSize);
            return await restClient.AtUrl(urlTemplate).Get<ConstituentSearchResponse>();
        }

        /// <summary>
        /// Search for constituents by card number.
        /// </summary>
        /// <param name="searchRequest"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentSearchResponse>> SearchByCardNumber(SearchRequest searchRequest)
        {
            return await restClient.AtUrl("CRM/Constituents/Search/ByCardNumber").Post<SearchRequest, ConstituentSearchResponse>(searchRequest);
        }

        /// <summary>
        /// Get constituent details along with primary address, primary salutation, primary electronic address, primary &amp; general phones and affiliates information.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentSnapshot>> GetConstituentSnapshot(string constituentId)
        {
             var urlTemplate = "CRM/Constituents/{0}/Snapshot";
             urlTemplate = string.Format(urlTemplate, constituentId);
            return await restClient.AtUrl(urlTemplate).Get<ConstituentSnapshot>();
        }

        /// <summary>
        /// Get constituent information for fundraising.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentDevelopmentInfo>> GetConstituentDevelopmentInfo(string constituentId)
        {
             var urlTemplate = "CRM/Constituents/{0}/DevelopmentInfo";
             urlTemplate = string.Format(urlTemplate, constituentId);
            return await restClient.AtUrl(urlTemplate).Get<ConstituentDevelopmentInfo>();
        }

        /// <summary>
        /// Swaps A1/A2 names on a household account and regenerates its salutation.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentSnapshot>> SwapConstituentA1A2(string constituentId)
        {
             var urlTemplate = "CRM/Constituents/{0}/Snapshot/SwapA1A2/";
             urlTemplate = string.Format(urlTemplate, constituentId);
            return await restClient.AtUrl(urlTemplate).Post<string, ConstituentSnapshot>(constituentId);
        }

        /// <summary>
        /// Create a constituent optionally with primary address, primary salutation, primary electronic address, primary &amp; general phones and affiliates information.
        /// </summary>
        /// <param name="constituentSnapshot"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentSnapshot>> CreateConstituentUsingSnapshot(ConstituentSnapshot constituentSnapshot)
        {
            return await restClient.AtUrl("CRM/Constituents/Snapshot/").Post<ConstituentSnapshot, ConstituentSnapshot>(constituentSnapshot);
        }

        /// <summary>
        /// Get multiple Constituents given a set of constituentIds.
        /// </summary>
        /// <param name="constituentIds"></param>
        /// <returns></returns>
        public async Task<RestResponse<Constituents>> GetConstituents(string constituentIds)
        {
            var urlTemplate = "CRM/Constituents/?constituentIds={0}";
            urlTemplate = string.Format(urlTemplate, constituentIds);
            return await restClient.AtUrl(urlTemplate).Get<Constituents>();
        }

        /// <summary>
        /// Get the details of a Constituent using id.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Constituent>> Get(string constituentId)
        {
             var urlTemplate = "CRM/Constituents/{0}";
             urlTemplate = string.Format(urlTemplate, constituentId);
            return await restClient.AtUrl(urlTemplate).Get<Constituent>();
        }

        /// <summary>
        /// Update a constituent. Only the information about constituent can be updated. If addresses, electronicAddresses, salutations or phones data are passed, they will be ignored.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="constituent"></param>
        /// <returns></returns>
        public async Task<RestResponse<Constituent>> Update(string constituentId, Constituent constituent)
        {
             var urlTemplate = "CRM/Constituents/{0}";
             urlTemplate = string.Format(urlTemplate, constituentId);
            return await restClient.AtUrl(urlTemplate).Put<Constituent, Constituent>(constituent);
        }

        /// <summary>
        /// Convert existing household to an individual.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentSnapshot>> ConvertGroupToIndividual(string constituentId, GroupToIndividualRequest request)
        {
             var urlTemplate = "CRM/Constituents/{0}/ConvertToIndividual";
             urlTemplate = string.Format(urlTemplate, constituentId);
            return await restClient.AtUrl(urlTemplate).Post<GroupToIndividualRequest, ConstituentSnapshot>(request);
        }

        /// <summary>
        /// Convert existing individual constituent to an organization.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentSnapshot>> ConvertIndividualToOrganization(string constituentId, IndividualToOrganizationRequest request)
        {
             var urlTemplate = "CRM/Constituents/{0}/ConvertToOrganization";
             urlTemplate = string.Format(urlTemplate, constituentId);
            return await restClient.AtUrl(urlTemplate).Post<IndividualToOrganizationRequest, ConstituentSnapshot>(request);
        }

        /// <summary>
        /// Convert existing individual constituent to a household.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentSnapshot>> ConvertIndividualToHousehold(string constituentId, IndividualToHouseholdRequest request)
        {
             var urlTemplate = "CRM/Constituents/{0}/ConvertToHousehold";
             urlTemplate = string.Format(urlTemplate, constituentId);
            return await restClient.AtUrl(urlTemplate).Post<IndividualToHouseholdRequest, ConstituentSnapshot>(request);
        }

    }
 

 
    /// 
    public class ConstituentsFacadeBatch
    {
        private IRestClient restClient;

        public ConstituentsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get constituent details with addresses, electronicAddresses, salutations and phones. To exclude information about visible affiliations pass includeAffiliations=\"false\"
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public Request GetConstituent(string constituentId = "", string includeAffiliations = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentDetail";
            bRequest.Content = null;

            var urlTemplate = "CRM/Constituents/{0}/Detail?includeAffiliations={1}";
            urlTemplate = string.Format(urlTemplate, constituentId, includeAffiliations);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new constituent with addresses, electronicAddresses, salutations and phones.
        /// </summary>
        /// <param name="constituent"></param>
        /// <returns></returns>
        public Request CreateConstituent(ConstituentDetail constituent, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentDetail";
            bRequest.Content = constituent;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/Constituents/Detail/";

            return bRequest;
        }

        /// <summary>
        /// Get primary household constituent details for a provided constituentId.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <returns></returns>
        public Request GetPrimaryHousehold(string constituentId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentDetail";
            bRequest.Content = null;

            var urlTemplate = "CRM/Constituents/PrimaryHousehold/?constituentId={0}";
            urlTemplate = string.Format(urlTemplate, constituentId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get the details of a flex header for a constituent
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="headerId"></param>
        /// <returns></returns>
        public Request GetFlexHeader(Int32 constituentId, Int32 headerId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.FlexHeader";
            bRequest.Content = null;

            var urlTemplate = "CRM/Constituents/{0}/Header/Flex/{1}";
            urlTemplate = string.Format(urlTemplate, constituentId, headerId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Constituent search
        /// </summary>
        /// <param name="type">One of basic, advanced, attribute or fluent</param>
        /// <param name="q">Use for fluent search</param>
        /// <param name="constituentGroups">One of individuals,organizations,households or comma separated combination. Leave blank to include all.</param>
        /// <param name="dup"></param>
        /// <param name="includeAffiliates"></param>
        /// <param name="constituencyIds"></param>
        /// <param name="listId"></param>
        /// <param name="ln"></param>
        /// <param name="fn"></param>
        /// <param name="constituentId"></param>
        /// <param name="street"></param>
        /// <param name="post"></param>
        /// <param name="atype"></param>
        /// <param name="op"></param>
        /// <param name="value"></param>
        /// <param name="key"></param>
        /// <param name="page"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public Request Search(string type, string q = "null", string constituentGroups = "null", string dup = "null", string includeAffiliates = "null", string constituencyIds = "null", string listId = "null", string ln = "null", string fn = "null", string constituentId = "null", string street = "null", string post = "null", string atype = "null", string op = "null", string value = "null", string key = "null", string page = "null", string pageSize = "null", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentSearchResponse";
            bRequest.Content = null;

            var urlTemplate = "CRM/Constituents/Search?type={0}&q={1}&constituentGroups={2}&dup={3}&includeAffiliates={4}&constituencyIds={5}&listId={6}&ln={7}&fn={8}&constituentId={9}&street={10}&post={11}&atype={12}&op={13}&value={14}&key={15}&page={16}&pageSize={17}";
            urlTemplate = string.Format(urlTemplate, type,q,constituentGroups,dup,includeAffiliates,constituencyIds,listId,ln,fn,constituentId,street,post,atype,op,value,key,page,pageSize);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Search for constituents by card number.
        /// </summary>
        /// <param name="searchRequest"></param>
        /// <returns></returns>
        public Request SearchByCardNumber(SearchRequest searchRequest, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentSearchResponse";
            bRequest.Content = searchRequest;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/Constituents/Search/ByCardNumber";

            return bRequest;
        }

        /// <summary>
        /// Get constituent details along with primary address, primary salutation, primary electronic address, primary &amp; general phones and affiliates information.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <returns></returns>
        public Request GetConstituentSnapshot(string constituentId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentSnapshot";
            bRequest.Content = null;

            var urlTemplate = "CRM/Constituents/{0}/Snapshot";
            urlTemplate = string.Format(urlTemplate, constituentId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get constituent information for fundraising.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <returns></returns>
        public Request GetConstituentDevelopmentInfo(string constituentId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentDevelopmentInfo";
            bRequest.Content = null;

            var urlTemplate = "CRM/Constituents/{0}/DevelopmentInfo";
            urlTemplate = string.Format(urlTemplate, constituentId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Swaps A1/A2 names on a household account and regenerates its salutation.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <returns></returns>
        public Request SwapConstituentA1A2(string constituentId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentSnapshot";
            bRequest.Content = constituentId;

            var urlTemplate = "CRM/Constituents/{0}/Snapshot/SwapA1A2/";
            urlTemplate = string.Format(urlTemplate, constituentId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a constituent optionally with primary address, primary salutation, primary electronic address, primary &amp; general phones and affiliates information.
        /// </summary>
        /// <param name="constituentSnapshot"></param>
        /// <returns></returns>
        public Request CreateConstituentUsingSnapshot(ConstituentSnapshot constituentSnapshot, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentSnapshot";
            bRequest.Content = constituentSnapshot;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/Constituents/Snapshot/";

            return bRequest;
        }

        /// <summary>
        /// Get multiple Constituents given a set of constituentIds.
        /// </summary>
        /// <param name="constituentIds"></param>
        /// <returns></returns>
        public Request GetConstituents(string constituentIds, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Constituents";
            bRequest.Content = null;

            var urlTemplate = "CRM/Constituents/?constituentIds={0}";
            urlTemplate = string.Format(urlTemplate, constituentIds);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get the details of a Constituent using id.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <returns></returns>
        public Request Get(string constituentId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Constituent";
            bRequest.Content = null;

            var urlTemplate = "CRM/Constituents/{0}";
            urlTemplate = string.Format(urlTemplate, constituentId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Update a constituent. Only the information about constituent can be updated. If addresses, electronicAddresses, salutations or phones data are passed, they will be ignored.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="constituent"></param>
        /// <returns></returns>
        public Request Update(string constituentId, Constituent constituent, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Constituent";
            bRequest.Content = constituent;

            var urlTemplate = "CRM/Constituents/{0}";
            urlTemplate = string.Format(urlTemplate, constituentId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Convert existing household to an individual.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request ConvertGroupToIndividual(string constituentId, GroupToIndividualRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentSnapshot";
            bRequest.Content = request;

            var urlTemplate = "CRM/Constituents/{0}/ConvertToIndividual";
            urlTemplate = string.Format(urlTemplate, constituentId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Convert existing individual constituent to an organization.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request ConvertIndividualToOrganization(string constituentId, IndividualToOrganizationRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentSnapshot";
            bRequest.Content = request;

            var urlTemplate = "CRM/Constituents/{0}/ConvertToOrganization";
            urlTemplate = string.Format(urlTemplate, constituentId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Convert existing individual constituent to a household.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request ConvertIndividualToHousehold(string constituentId, IndividualToHouseholdRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentSnapshot";
            bRequest.Content = request;

            var urlTemplate = "CRM/Constituents/{0}/ConvertToHousehold";
            urlTemplate = string.Format(urlTemplate, constituentId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ContactPermissionsFacade
    {
        private IRestClient restClient;

        public ContactPermissionsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all the contact permissions for the specified constituent and its affiliations if requested
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <param name="activeOnly"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPermissions>> GetAll(string constituentId = "", string includeAffiliations = "", string activeOnly = "")
        {
            var urlTemplate = "CRM/ContactPermissions/?constituentId={0}&includeAffiliations={1}&activeOnly={2}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations,activeOnly);
            return await restClient.AtUrl(urlTemplate).Get<ContactPermissions>();
        }

        /// <summary>
        /// Get details of a contact permission
        /// </summary>
        /// <param name="contactPermissionId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPermission>> Get(string contactPermissionId)
        {
             var urlTemplate = "CRM/ContactPermissions/{0}";
             urlTemplate = string.Format(urlTemplate, contactPermissionId);
            return await restClient.AtUrl(urlTemplate).Get<ContactPermission>();
        }

        /// <summary>
        /// Request a set of contact permissions relevant to an order or contribution context.  Send request with ReturnRequiredOnly to true to only send back permissions that require constituent ask.
        /// </summary>
        /// <param name="contactPermissionsTransactionRequest"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPermissions>> ForTransaction(ContactPermissionsTransactionRequest contactPermissionsTransactionRequest)
        {
            return await restClient.AtUrl("CRM/ContactPermissions/ForTransaction").Post<ContactPermissionsTransactionRequest, ContactPermissions>(contactPermissionsTransactionRequest);
        }

        /// <summary>
        /// Create a new contact permission
        /// </summary>
        /// <param name="contactPermission"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPermission>> Create(ContactPermission contactPermission)
        {
            return await restClient.AtUrl("CRM/ContactPermissions/").Post<ContactPermission, ContactPermission>(contactPermission);
        }

        /// <summary>
        /// Update a contact permission
        /// </summary>
        /// <param name="contactPermissionId"></param>
        /// <param name="contactPermission"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPermission>> Update(string contactPermissionId, ContactPermission contactPermission)
        {
             var urlTemplate = "CRM/ContactPermissions/{0}";
             urlTemplate = string.Format(urlTemplate, contactPermissionId);
            return await restClient.AtUrl(urlTemplate).Put<ContactPermission, ContactPermission>(contactPermission);
        }

        /// <summary>
        /// Delete a contact permission
        /// </summary>
        /// <param name="contactPermissionId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string contactPermissionId)
        {
             var urlTemplate = "CRM/ContactPermissions/{0}";
             urlTemplate = string.Format(urlTemplate, contactPermissionId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ContactPermissionsFacadeBatch
    {
        private IRestClient restClient;

        public ContactPermissionsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all the contact permissions for the specified constituent and its affiliations if requested
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <param name="activeOnly"></param>
        /// <returns></returns>
        public Request GetAll(string constituentId = "", string includeAffiliations = "", string activeOnly = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPermissions";
            bRequest.Content = null;

            var urlTemplate = "CRM/ContactPermissions/?constituentId={0}&includeAffiliations={1}&activeOnly={2}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations,activeOnly);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a contact permission
        /// </summary>
        /// <param name="contactPermissionId"></param>
        /// <returns></returns>
        public Request Get(string contactPermissionId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPermission";
            bRequest.Content = null;

            var urlTemplate = "CRM/ContactPermissions/{0}";
            urlTemplate = string.Format(urlTemplate, contactPermissionId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Request a set of contact permissions relevant to an order or contribution context.  Send request with ReturnRequiredOnly to true to only send back permissions that require constituent ask.
        /// </summary>
        /// <param name="contactPermissionsTransactionRequest"></param>
        /// <returns></returns>
        public Request ForTransaction(ContactPermissionsTransactionRequest contactPermissionsTransactionRequest, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPermissions";
            bRequest.Content = contactPermissionsTransactionRequest;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/ContactPermissions/ForTransaction";

            return bRequest;
        }

        /// <summary>
        /// Create a new contact permission
        /// </summary>
        /// <param name="contactPermission"></param>
        /// <returns></returns>
        public Request Create(ContactPermission contactPermission, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPermission";
            bRequest.Content = contactPermission;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/ContactPermissions/";

            return bRequest;
        }

        /// <summary>
        /// Update a contact permission
        /// </summary>
        /// <param name="contactPermissionId"></param>
        /// <param name="contactPermission"></param>
        /// <returns></returns>
        public Request Update(string contactPermissionId, ContactPermission contactPermission, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPermission";
            bRequest.Content = contactPermission;

            var urlTemplate = "CRM/ContactPermissions/{0}";
            urlTemplate = string.Format(urlTemplate, contactPermissionId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete a contact permission
        /// </summary>
        /// <param name="contactPermissionId"></param>
        public Request Delete(string contactPermissionId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "CRM/ContactPermissions/{0}";
            urlTemplate = string.Format(urlTemplate, contactPermissionId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ContactPointPurposeMapsFacade
    {
        private IRestClient restClient;

        public ContactPointPurposeMapsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the contact point purposes for the specified constituent (constituentId) and all its visible affiliation's contact point purposes as well. To exclude contact point purposes of the visible affiliations pass includeAffiliations=\"false\". To get contact point purposes for a contact point pass contactPointId.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <param name="contactPointId"></param>
        /// <param name="contactPointCategoryId"></param>
        /// <param name="purposeId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPointPurposeMaps>> GetAll(string constituentId = "", string includeAffiliations = "", string contactPointId = "", string contactPointCategoryId = "", string purposeId = "")
        {
            var urlTemplate = "CRM/ContactPointPurposeMaps/?constituentId={0}&includeAffiliations={1}&contactPointId={2}&contactPointCategoryId={3}&purposeId={4}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations,contactPointId,contactPointCategoryId,purposeId);
            return await restClient.AtUrl(urlTemplate).Get<ContactPointPurposeMaps>();
        }

        /// <summary>
        /// Get details of a contact point purpose.
        /// </summary>
        /// <param name="contactPointPurposeMapId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPointPurposeMap>> Get(string contactPointPurposeMapId = "")
        {
             var urlTemplate = "CRM/ContactPointPurposeMaps/{0}";
             urlTemplate = string.Format(urlTemplate, contactPointPurposeMapId);
            return await restClient.AtUrl(urlTemplate).Get<ContactPointPurposeMap>();
        }

        /// <summary>
        /// Create a new contact point purpose.
        /// </summary>
        /// <param name="contactPointPurposeMap"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPointPurposeMap>> Create(ContactPointPurposeMap contactPointPurposeMap)
        {
            return await restClient.AtUrl("CRM/ContactPointPurposeMaps/").Post<ContactPointPurposeMap, ContactPointPurposeMap>(contactPointPurposeMap);
        }

        /// <summary>
        /// Update a contact point purpose.
        /// </summary>
        /// <param name="contactPointPurposeMapId"></param>
        /// <param name="contactPointPurposeMap"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPointPurposeMap>> Update(string contactPointPurposeMapId, ContactPointPurposeMap contactPointPurposeMap)
        {
             var urlTemplate = "CRM/ContactPointPurposeMaps/{0}";
             urlTemplate = string.Format(urlTemplate, contactPointPurposeMapId);
            return await restClient.AtUrl(urlTemplate).Put<ContactPointPurposeMap, ContactPointPurposeMap>(contactPointPurposeMap);
        }

        /// <summary>
        /// Delete a contact point purpose.
        /// </summary>
        /// <param name="contactPointPurposeMapId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string contactPointPurposeMapId)
        {
             var urlTemplate = "CRM/ContactPointPurposeMaps/{0}";
             urlTemplate = string.Format(urlTemplate, contactPointPurposeMapId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ContactPointPurposeMapsFacadeBatch
    {
        private IRestClient restClient;

        public ContactPointPurposeMapsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the contact point purposes for the specified constituent (constituentId) and all its visible affiliation's contact point purposes as well. To exclude contact point purposes of the visible affiliations pass includeAffiliations=\"false\". To get contact point purposes for a contact point pass contactPointId.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <param name="contactPointId"></param>
        /// <param name="contactPointCategoryId"></param>
        /// <param name="purposeId"></param>
        /// <returns></returns>
        public Request GetAll(string constituentId = "", string includeAffiliations = "", string contactPointId = "", string contactPointCategoryId = "", string purposeId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPointPurposeMaps";
            bRequest.Content = null;

            var urlTemplate = "CRM/ContactPointPurposeMaps/?constituentId={0}&includeAffiliations={1}&contactPointId={2}&contactPointCategoryId={3}&purposeId={4}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations,contactPointId,contactPointCategoryId,purposeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a contact point purpose.
        /// </summary>
        /// <param name="contactPointPurposeMapId"></param>
        /// <returns></returns>
        public Request Get(string contactPointPurposeMapId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPointPurposeMap";
            bRequest.Content = null;

            var urlTemplate = "CRM/ContactPointPurposeMaps/{0}";
            urlTemplate = string.Format(urlTemplate, contactPointPurposeMapId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new contact point purpose.
        /// </summary>
        /// <param name="contactPointPurposeMap"></param>
        /// <returns></returns>
        public Request Create(ContactPointPurposeMap contactPointPurposeMap, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPointPurposeMap";
            bRequest.Content = contactPointPurposeMap;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/ContactPointPurposeMaps/";

            return bRequest;
        }

        /// <summary>
        /// Update a contact point purpose.
        /// </summary>
        /// <param name="contactPointPurposeMapId"></param>
        /// <param name="contactPointPurposeMap"></param>
        /// <returns></returns>
        public Request Update(string contactPointPurposeMapId, ContactPointPurposeMap contactPointPurposeMap, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPointPurposeMap";
            bRequest.Content = contactPointPurposeMap;

            var urlTemplate = "CRM/ContactPointPurposeMaps/{0}";
            urlTemplate = string.Format(urlTemplate, contactPointPurposeMapId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete a contact point purpose.
        /// </summary>
        /// <param name="contactPointPurposeMapId"></param>
        public Request Delete(string contactPointPurposeMapId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "CRM/ContactPointPurposeMaps/{0}";
            urlTemplate = string.Format(urlTemplate, contactPointPurposeMapId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ContactPointsFacade
    {
        private IRestClient restClient;

        public ContactPointsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all the delivery points for the specified constituent (constituentId) and all its visible affiliation's delivery point purposes as well. To exclude delivery point purposes of the visible affiliations pass includeAffiliations=\"false\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPoints>> GetAll(string constituentId = "", string includeAffiliations = "")
        {
            var urlTemplate = "CRM/ContactPoints/?constituentId={0}&includeAffiliations={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations);
            return await restClient.AtUrl(urlTemplate).Get<ContactPoints>();
        }

    }
 

 
    /// 
    public class ContactPointsFacadeBatch
    {
        private IRestClient restClient;

        public ContactPointsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all the delivery points for the specified constituent (constituentId) and all its visible affiliation's delivery point purposes as well. To exclude delivery point purposes of the visible affiliations pass includeAffiliations=\"false\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public Request GetAll(string constituentId = "", string includeAffiliations = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPoints";
            bRequest.Content = null;

            var urlTemplate = "CRM/ContactPoints/?constituentId={0}&includeAffiliations={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ElectronicAddressesFacade
    {
        private IRestClient restClient;

        public ElectronicAddressesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the electronic addresses for the specified constituent id and all its visible affiliation's electronic addresses as well. To exclude electronic addresses of the visible affiliations pass includeAffiliations=\"false\".To Get The primary electronic addresses alone, pass primaryOnly=\"true\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <param name="primaryOnly"></param>
        /// <param name="includeFromAffiliations"></param>
        /// <returns></returns>
        public async Task<RestResponse<ElectronicAddresses>> GetAll(string constituentId = "", string includeAffiliations = "", string primaryOnly = "", string includeFromAffiliations = "")
        {
            var urlTemplate = "CRM/ElectronicAddresses/?constituentId={0}&includeAffiliations={1}&primaryOnly={2}&includeFromAffiliations={3}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations,primaryOnly,includeFromAffiliations);
            return await restClient.AtUrl(urlTemplate).Get<ElectronicAddresses>();
        }

        /// <summary>
        /// Get details of an electronic address.
        /// </summary>
        /// <param name="electronicAddressId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ElectronicAddress>> Get(string electronicAddressId = "")
        {
             var urlTemplate = "CRM/ElectronicAddresses/{0}";
             urlTemplate = string.Format(urlTemplate, electronicAddressId);
            return await restClient.AtUrl(urlTemplate).Get<ElectronicAddress>();
        }

        /// <summary>
        /// Check if the specified electronic address is attached to a web login.
        /// </summary>
        /// <param name="electronicAddressId"></param>
        /// <returns></returns>
        public async Task<RestResponse<AttachedToLogin>> IsAttachedToLogin(string electronicAddressId = "")
        {
             var urlTemplate = "CRM/ElectronicAddresses/{0}/IsAttachedToLogin";
             urlTemplate = string.Format(urlTemplate, electronicAddressId);
            return await restClient.AtUrl(urlTemplate).Get<AttachedToLogin>();
        }

        /// <summary>
        /// Change the ownership of the electronic address to a new constituent.
        /// </summary>
        /// <param name="electronicAddressId"></param>
        /// <param name="constituentId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ElectronicAddress>> Move(string electronicAddressId, string constituentId)
        {
             var urlTemplate = "CRM/ElectronicAddresses/{0}/MoveTo/{1}";
             urlTemplate = string.Format(urlTemplate, electronicAddressId);
            return await restClient.AtUrl(urlTemplate).Post<string, ElectronicAddress>(constituentId);
        }

        /// <summary>
        /// Create a new electronic address.
        /// </summary>
        /// <param name="electronicAddress"></param>
        /// <returns></returns>
        public async Task<RestResponse<ElectronicAddress>> Create(ElectronicAddress electronicAddress)
        {
            return await restClient.AtUrl("CRM/ElectronicAddresses/").Post<ElectronicAddress, ElectronicAddress>(electronicAddress);
        }

        /// <summary>
        /// Update an electronic address.
        /// </summary>
        /// <param name="electronicAddressId"></param>
        /// <param name="electronicAddress"></param>
        /// <returns></returns>
        public async Task<RestResponse<ElectronicAddress>> Update(string electronicAddressId, ElectronicAddress electronicAddress)
        {
             var urlTemplate = "CRM/ElectronicAddresses/{0}";
             urlTemplate = string.Format(urlTemplate, electronicAddressId);
            return await restClient.AtUrl(urlTemplate).Put<ElectronicAddress, ElectronicAddress>(electronicAddress);
        }

        /// <summary>
        /// Delete an electronic address.
        /// </summary>
        /// <param name="electronicAddressId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string electronicAddressId)
        {
             var urlTemplate = "CRM/ElectronicAddresses/{0}";
             urlTemplate = string.Format(urlTemplate, electronicAddressId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ElectronicAddressesFacadeBatch
    {
        private IRestClient restClient;

        public ElectronicAddressesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the electronic addresses for the specified constituent id and all its visible affiliation's electronic addresses as well. To exclude electronic addresses of the visible affiliations pass includeAffiliations=\"false\".To Get The primary electronic addresses alone, pass primaryOnly=\"true\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <param name="primaryOnly"></param>
        /// <param name="includeFromAffiliations"></param>
        /// <returns></returns>
        public Request GetAll(string constituentId = "", string includeAffiliations = "", string primaryOnly = "", string includeFromAffiliations = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ElectronicAddresses";
            bRequest.Content = null;

            var urlTemplate = "CRM/ElectronicAddresses/?constituentId={0}&includeAffiliations={1}&primaryOnly={2}&includeFromAffiliations={3}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations,primaryOnly,includeFromAffiliations);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of an electronic address.
        /// </summary>
        /// <param name="electronicAddressId"></param>
        /// <returns></returns>
        public Request Get(string electronicAddressId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ElectronicAddress";
            bRequest.Content = null;

            var urlTemplate = "CRM/ElectronicAddresses/{0}";
            urlTemplate = string.Format(urlTemplate, electronicAddressId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Check if the specified electronic address is attached to a web login.
        /// </summary>
        /// <param name="electronicAddressId"></param>
        /// <returns></returns>
        public Request IsAttachedToLogin(string electronicAddressId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AttachedToLogin";
            bRequest.Content = null;

            var urlTemplate = "CRM/ElectronicAddresses/{0}/IsAttachedToLogin";
            urlTemplate = string.Format(urlTemplate, electronicAddressId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Change the ownership of the electronic address to a new constituent.
        /// </summary>
        /// <param name="electronicAddressId"></param>
        /// <param name="constituentId"></param>
        /// <returns></returns>
        public Request Move(string electronicAddressId, string constituentId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ElectronicAddress";
            bRequest.Content = constituentId;

            var urlTemplate = "CRM/ElectronicAddresses/{0}/MoveTo/{1}";
            urlTemplate = string.Format(urlTemplate, electronicAddressId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new electronic address.
        /// </summary>
        /// <param name="electronicAddress"></param>
        /// <returns></returns>
        public Request Create(ElectronicAddress electronicAddress, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ElectronicAddress";
            bRequest.Content = electronicAddress;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/ElectronicAddresses/";

            return bRequest;
        }

        /// <summary>
        /// Update an electronic address.
        /// </summary>
        /// <param name="electronicAddressId"></param>
        /// <param name="electronicAddress"></param>
        /// <returns></returns>
        public Request Update(string electronicAddressId, ElectronicAddress electronicAddress, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ElectronicAddress";
            bRequest.Content = electronicAddress;

            var urlTemplate = "CRM/ElectronicAddresses/{0}";
            urlTemplate = string.Format(urlTemplate, electronicAddressId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an electronic address.
        /// </summary>
        /// <param name="electronicAddressId"></param>
        public Request Delete(string electronicAddressId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "CRM/ElectronicAddresses/{0}";
            urlTemplate = string.Format(urlTemplate, electronicAddressId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// <summary>
    /// NOTE:  Gift Aid functionality is for use by UK organisations only.
    /// Gift Aid payments are updated by a trigger on T_GIFTAID_DECLARATION after the declaration is updated or inserted.  Changes in eligibility periods will affect other gift aid payments than the current cart based upon the system rules.
    /// </summary>
    public class GiftAidDeclarationsFacade
    {
        private IRestClient restClient;

        public GiftAidDeclarationsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Gets all Gift Aid Declarations for a provided constituent including primary affiliates by default.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        public async Task<RestResponse<GiftAidDeclarations>> GetAll(string constituentId = "", string includeAffiliations = "")
        {
            var urlTemplate = "CRM/GiftAidDeclarations/?constituentId={0}&includeAffiliations={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations);
            return await restClient.AtUrl(urlTemplate).Get<GiftAidDeclarations>();
        }

        /// <summary>
        /// Gets a single Gift Aid Declaration.
        /// </summary>
        /// <param name="giftAidDeclarationId"></param>
        public async Task<RestResponse<GiftAidDeclaration>> Get(string giftAidDeclarationId)
        {
             var urlTemplate = "CRM/GiftAidDeclarations/{0}";
             urlTemplate = string.Format(urlTemplate, giftAidDeclarationId);
            return await restClient.AtUrl(urlTemplate).Get<GiftAidDeclaration>();
        }

        /// <summary>
        /// Creates a Gift Aid Declaration.
        /// </summary>
        public async Task<RestResponse<GiftAidDeclaration>> Create(GiftAidDeclaration giftAidDeclaration)
        {
            return await restClient.AtUrl("CRM/GiftAidDeclarations/").Post<GiftAidDeclaration, GiftAidDeclaration>(giftAidDeclaration);
        }

        /// <summary>
        /// Update a Gift Aid Declaration.
        /// </summary>
        /// <param name="giftAidDeclarationId"></param>
        /// <param name="giftAidDeclaration"></param>
        public async Task<RestResponse<GiftAidDeclaration>> Update(string giftAidDeclarationId, GiftAidDeclaration giftAidDeclaration)
        {
             var urlTemplate = "CRM/GiftAidDeclarations/{0}";
             urlTemplate = string.Format(urlTemplate, giftAidDeclarationId);
            return await restClient.AtUrl(urlTemplate).Put<GiftAidDeclaration, GiftAidDeclaration>(giftAidDeclaration);
        }

        /// <summary>
        /// Delete a Gift Aid Declaration.
        /// </summary>
        /// <param name="giftAidDeclarationId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string giftAidDeclarationId)
        {
             var urlTemplate = "CRM/GiftAidDeclarations/{0}";
             urlTemplate = string.Format(urlTemplate, giftAidDeclarationId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// <summary>
    /// NOTE:  Gift Aid functionality is for use by UK organisations only.
    /// Gift Aid payments are updated by a trigger on T_GIFTAID_DECLARATION after the declaration is updated or inserted.  Changes in eligibility periods will affect other gift aid payments than the current cart based upon the system rules.
    /// </summary>
    public class GiftAidDeclarationsFacadeBatch
    {
        private IRestClient restClient;

        public GiftAidDeclarationsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Gets all Gift Aid Declarations for a provided constituent including primary affiliates by default.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        public Request GetAll(string constituentId = "", string includeAffiliations = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidDeclarations";
            bRequest.Content = null;

            var urlTemplate = "CRM/GiftAidDeclarations/?constituentId={0}&includeAffiliations={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Gets a single Gift Aid Declaration.
        /// </summary>
        /// <param name="giftAidDeclarationId"></param>
        public Request Get(string giftAidDeclarationId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidDeclaration";
            bRequest.Content = null;

            var urlTemplate = "CRM/GiftAidDeclarations/{0}";
            urlTemplate = string.Format(urlTemplate, giftAidDeclarationId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Creates a Gift Aid Declaration.
        /// </summary>
        public Request Create(GiftAidDeclaration giftAidDeclaration, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidDeclaration";
            bRequest.Content = giftAidDeclaration;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/GiftAidDeclarations/";

            return bRequest;
        }

        /// <summary>
        /// Update a Gift Aid Declaration.
        /// </summary>
        /// <param name="giftAidDeclarationId"></param>
        /// <param name="giftAidDeclaration"></param>
        public Request Update(string giftAidDeclarationId, GiftAidDeclaration giftAidDeclaration, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidDeclaration";
            bRequest.Content = giftAidDeclaration;

            var urlTemplate = "CRM/GiftAidDeclarations/{0}";
            urlTemplate = string.Format(urlTemplate, giftAidDeclarationId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete a Gift Aid Declaration.
        /// </summary>
        /// <param name="giftAidDeclarationId"></param>
        public Request Delete(string giftAidDeclarationId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "CRM/GiftAidDeclarations/{0}";
            urlTemplate = string.Format(urlTemplate, giftAidDeclarationId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class InterestsFacade
    {
        private IRestClient restClient;

        public InterestsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of an interest.
        /// </summary>
        /// <param name="interestId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Interest>> Get(string interestId = "")
        {
             var urlTemplate = "CRM/Interests/{0}";
             urlTemplate = string.Format(urlTemplate, interestId);
            return await restClient.AtUrl(urlTemplate).Get<Interest>();
        }

        /// <summary>
        /// Get all the interests of the specified constituent id. To exclude attributes of the visible affiliations pass includeAffiliations=\"false\". To filter the interests of specific categories pass comma separted values under categories.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="categoryIds"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public async Task<RestResponse<Interests>> GetAll(string constituentId = "", string categoryIds = "", string includeAffiliations = "")
        {
            var urlTemplate = "CRM/Interests/?constituentId={0}&categoryIds={1}&includeAffiliations={2}";
            urlTemplate = string.Format(urlTemplate, constituentId,categoryIds,includeAffiliations);
            return await restClient.AtUrl(urlTemplate).Get<Interests>();
        }

        /// <summary>
        /// Create a new interest.
        /// </summary>
        /// <param name="interest"></param>
        /// <returns></returns>
        public async Task<RestResponse<Interest>> Create(Interest interest)
        {
            return await restClient.AtUrl("CRM/Interests/").Post<Interest, Interest>(interest);
        }

        /// <summary>
        /// Update an interest.
        /// </summary>
        /// <param name="interestId"></param>
        /// <param name="interest"></param>
        /// <returns></returns>
        public async Task<RestResponse<Interest>> Update(string interestId, Interest interest)
        {
             var urlTemplate = "CRM/Interests/{0}";
             urlTemplate = string.Format(urlTemplate, interestId);
            return await restClient.AtUrl(urlTemplate).Put<Interest, Interest>(interest);
        }

        /// <summary>
        /// Delete an interest.
        /// </summary>
        /// <param name="interestId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string interestId)
        {
             var urlTemplate = "CRM/Interests/{0}";
             urlTemplate = string.Format(urlTemplate, interestId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class InterestsFacadeBatch
    {
        private IRestClient restClient;

        public InterestsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of an interest.
        /// </summary>
        /// <param name="interestId"></param>
        /// <returns></returns>
        public Request Get(string interestId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Interest";
            bRequest.Content = null;

            var urlTemplate = "CRM/Interests/{0}";
            urlTemplate = string.Format(urlTemplate, interestId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get all the interests of the specified constituent id. To exclude attributes of the visible affiliations pass includeAffiliations=\"false\". To filter the interests of specific categories pass comma separted values under categories.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="categoryIds"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public Request GetAll(string constituentId = "", string categoryIds = "", string includeAffiliations = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Interests";
            bRequest.Content = null;

            var urlTemplate = "CRM/Interests/?constituentId={0}&categoryIds={1}&includeAffiliations={2}";
            urlTemplate = string.Format(urlTemplate, constituentId,categoryIds,includeAffiliations);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new interest.
        /// </summary>
        /// <param name="interest"></param>
        /// <returns></returns>
        public Request Create(Interest interest, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Interest";
            bRequest.Content = interest;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/Interests/";

            return bRequest;
        }

        /// <summary>
        /// Update an interest.
        /// </summary>
        /// <param name="interestId"></param>
        /// <param name="interest"></param>
        /// <returns></returns>
        public Request Update(string interestId, Interest interest, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Interest";
            bRequest.Content = interest;

            var urlTemplate = "CRM/Interests/{0}";
            urlTemplate = string.Format(urlTemplate, interestId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an interest.
        /// </summary>
        /// <param name="interestId"></param>
        public Request Delete(string interestId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "CRM/Interests/{0}";
            urlTemplate = string.Format(urlTemplate, interestId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class InternalFacade
    {
        private IRestClient restClient;

        public InternalFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the addresses and the phones attached to them of the constituent id. To exclude addresses and the phones of the visible affiliations pass includeAffiliations=\"false\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <param name="includeFromAffiliations"></param>
        /// <returns></returns>
        public async Task<RestResponse<AddressDetails>> GetAll(string constituentId = "", string includeAffiliations = "", string includeFromAffiliations = "")
        {
            var urlTemplate = "CRM/Internal/AddressDetails/?constituentId={0}&includeAffiliations={1}&includeFromAffiliations={2}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations,includeFromAffiliations);
            return await restClient.AtUrl(urlTemplate).Get<AddressDetails>();
        }

        /// <summary>
        /// Get details of an address and all the phones attached to it.
        /// </summary>
        /// <param name="addressId"></param>
        /// <returns></returns>
        public async Task<RestResponse<AddressDetail>> Get(string addressId = "")
        {
             var urlTemplate = "CRM/Internal/AddressDetails/{0}";
             urlTemplate = string.Format(urlTemplate, addressId);
            return await restClient.AtUrl(urlTemplate).Get<AddressDetail>();
        }

        /// <summary>
        /// Create a new address along with the phones and attach all the phones to the address. By default first phone is of phone type 1, second phone is of phone type 2 and third phone is of phone type 3.
        /// </summary>
        /// <param name="addressDetail"></param>
        /// <returns></returns>
        public async Task<RestResponse<AddressDetail>> Create(AddressDetail addressDetail)
        {
            return await restClient.AtUrl("CRM/Internal/AddressDetails/").Post<AddressDetail, AddressDetail>(addressDetail);
        }

        /// <summary>
        /// Update an address and phones. If the entire information about a phone is added newly then create a new phone. If the phone number of a phone is not given then delete that phone.
        /// </summary>
        /// <param name="addressId"></param>
        /// <param name="addressDetail"></param>
        /// <returns></returns>
        public async Task<RestResponse<AddressDetail>> Update(string addressId, AddressDetail addressDetail)
        {
             var urlTemplate = "CRM/Internal/AddressDetails/{0}";
             urlTemplate = string.Format(urlTemplate, addressId);
            return await restClient.AtUrl(urlTemplate).Put<AddressDetail, AddressDetail>(addressDetail);
        }

        /// <summary>
        /// Get constituent details along with primary address, primary salutation, primary electronic address, primary &amp; general phones.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentMiniSnapshot>> GetConstituentMiniSnapshot(string constituentId = "")
        {
             var urlTemplate = "CRM/Internal/ConstituentMiniSnapshot/{0}";
             urlTemplate = string.Format(urlTemplate, constituentId);
            return await restClient.AtUrl(urlTemplate).Get<ConstituentMiniSnapshot>();
        }

    }
 

 
    /// 
    public class InternalFacadeBatch
    {
        private IRestClient restClient;

        public InternalFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the addresses and the phones attached to them of the constituent id. To exclude addresses and the phones of the visible affiliations pass includeAffiliations=\"false\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <param name="includeFromAffiliations"></param>
        /// <returns></returns>
        public Request GetAll(string constituentId = "", string includeAffiliations = "", string includeFromAffiliations = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AddressDetails";
            bRequest.Content = null;

            var urlTemplate = "CRM/Internal/AddressDetails/?constituentId={0}&includeAffiliations={1}&includeFromAffiliations={2}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations,includeFromAffiliations);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of an address and all the phones attached to it.
        /// </summary>
        /// <param name="addressId"></param>
        /// <returns></returns>
        public Request Get(string addressId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AddressDetail";
            bRequest.Content = null;

            var urlTemplate = "CRM/Internal/AddressDetails/{0}";
            urlTemplate = string.Format(urlTemplate, addressId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new address along with the phones and attach all the phones to the address. By default first phone is of phone type 1, second phone is of phone type 2 and third phone is of phone type 3.
        /// </summary>
        /// <param name="addressDetail"></param>
        /// <returns></returns>
        public Request Create(AddressDetail addressDetail, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AddressDetail";
            bRequest.Content = addressDetail;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/Internal/AddressDetails/";

            return bRequest;
        }

        /// <summary>
        /// Update an address and phones. If the entire information about a phone is added newly then create a new phone. If the phone number of a phone is not given then delete that phone.
        /// </summary>
        /// <param name="addressId"></param>
        /// <param name="addressDetail"></param>
        /// <returns></returns>
        public Request Update(string addressId, AddressDetail addressDetail, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AddressDetail";
            bRequest.Content = addressDetail;

            var urlTemplate = "CRM/Internal/AddressDetails/{0}";
            urlTemplate = string.Format(urlTemplate, addressId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get constituent details along with primary address, primary salutation, primary electronic address, primary &amp; general phones.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <returns></returns>
        public Request GetConstituentMiniSnapshot(string constituentId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentMiniSnapshot";
            bRequest.Content = null;

            var urlTemplate = "CRM/Internal/ConstituentMiniSnapshot/{0}";
            urlTemplate = string.Format(urlTemplate, constituentId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class IssuesFacade
    {
        private IRestClient restClient;

        public IssuesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all the details of all the issues for the specified constituent id. If you want to filter the issues based on date pass in the values for 'startDate' and 'endDate'. If you want to filter issues based on contact type, category, activity type, origin, performance number or package number pass in the corresponding values in comma separated values.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <param name="contactTypeIds"></param>
        /// <param name="categoryIds"></param>
        /// <param name="activityTypeIds"></param>
        /// <param name="originIds"></param>
        /// <param name="performanceIds"></param>
        /// <param name="packageIds"></param>
        /// <param name="resolved"></param>
        /// <returns></returns>
        public async Task<RestResponse<Issues>> GetAll(string constituentId = "", string includeAffiliations = "", string startDate = "", string endDate = "", string contactTypeIds = "", string categoryIds = "", string activityTypeIds = "", string originIds = "", string performanceIds = "", string packageIds = "", string resolved = "")
        {
            var urlTemplate = "CRM/Issues/?constituentId={0}&includeAffiliations={1}&startDate={2}&endDate={3}&contactTypeIds={4}&categoryIds={5}&activityTypeIds={6}&originIds={7}&performanceIds={8}&packageIds={9}&resolved={10}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations,startDate,endDate,contactTypeIds,categoryIds,activityTypeIds,originIds,performanceIds,packageIds,resolved);
            return await restClient.AtUrl(urlTemplate).Get<Issues>();
        }

        /// <summary>
        /// Get details of a customer issue.
        /// </summary>
        /// <param name="issueId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Issue>> Get(string issueId = "")
        {
             var urlTemplate = "CRM/Issues/{0}";
             urlTemplate = string.Format(urlTemplate, issueId);
            return await restClient.AtUrl(urlTemplate).Get<Issue>();
        }

        /// <summary>
        /// Create an issue for a Constituent
        /// </summary>
        /// <param name="issue"></param>
        /// <returns></returns>
        public async Task<RestResponse<Issue>> Create(Issue issue)
        {
            return await restClient.AtUrl("CRM/Issues/").Post<Issue, Issue>(issue);
        }

        /// <summary>
        /// Update an issue for a Constituent
        /// </summary>
        /// <param name="issueId"></param>
        /// <param name="issue"></param>
        /// <returns></returns>
        public async Task<RestResponse<Issue>> Update(string issueId, Issue issue)
        {
             var urlTemplate = "CRM/Issues/{0}";
             urlTemplate = string.Format(urlTemplate, issueId);
            return await restClient.AtUrl(urlTemplate).Put<Issue, Issue>(issue);
        }

        /// <summary>
        /// Delete an issue by id.
        /// </summary>
        /// <param name="issueId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string issueId)
        {
             var urlTemplate = "CRM/Issues/{0}";
             urlTemplate = string.Format(urlTemplate, issueId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class IssuesFacadeBatch
    {
        private IRestClient restClient;

        public IssuesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all the details of all the issues for the specified constituent id. If you want to filter the issues based on date pass in the values for 'startDate' and 'endDate'. If you want to filter issues based on contact type, category, activity type, origin, performance number or package number pass in the corresponding values in comma separated values.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <param name="contactTypeIds"></param>
        /// <param name="categoryIds"></param>
        /// <param name="activityTypeIds"></param>
        /// <param name="originIds"></param>
        /// <param name="performanceIds"></param>
        /// <param name="packageIds"></param>
        /// <param name="resolved"></param>
        /// <returns></returns>
        public Request GetAll(string constituentId = "", string includeAffiliations = "", string startDate = "", string endDate = "", string contactTypeIds = "", string categoryIds = "", string activityTypeIds = "", string originIds = "", string performanceIds = "", string packageIds = "", string resolved = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Issues";
            bRequest.Content = null;

            var urlTemplate = "CRM/Issues/?constituentId={0}&includeAffiliations={1}&startDate={2}&endDate={3}&contactTypeIds={4}&categoryIds={5}&activityTypeIds={6}&originIds={7}&performanceIds={8}&packageIds={9}&resolved={10}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations,startDate,endDate,contactTypeIds,categoryIds,activityTypeIds,originIds,performanceIds,packageIds,resolved);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a customer issue.
        /// </summary>
        /// <param name="issueId"></param>
        /// <returns></returns>
        public Request Get(string issueId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Issue";
            bRequest.Content = null;

            var urlTemplate = "CRM/Issues/{0}";
            urlTemplate = string.Format(urlTemplate, issueId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create an issue for a Constituent
        /// </summary>
        /// <param name="issue"></param>
        /// <returns></returns>
        public Request Create(Issue issue, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Issue";
            bRequest.Content = issue;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/Issues/";

            return bRequest;
        }

        /// <summary>
        /// Update an issue for a Constituent
        /// </summary>
        /// <param name="issueId"></param>
        /// <param name="issue"></param>
        /// <returns></returns>
        public Request Update(string issueId, Issue issue, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Issue";
            bRequest.Content = issue;

            var urlTemplate = "CRM/Issues/{0}";
            urlTemplate = string.Format(urlTemplate, issueId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an issue by id.
        /// </summary>
        /// <param name="issueId"></param>
        public Request Delete(string issueId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "CRM/Issues/{0}";
            urlTemplate = string.Format(urlTemplate, issueId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class MembershipsFacade
    {
        private IRestClient restClient;

        public MembershipsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<MembershipDetails>> GetAll(string constituentId, Boolean? includeAffiliations = null, string membershipOrgIds = "null", Boolean? onlyShowCurrent = null, Boolean? onlyShowDefault = null)
        {
            var urlTemplate = "CRM/Memberships/Details?constituentId={0}&includeAffiliations={1}&membershipOrgIds={2}&onlyShowCurrent={3}&onlyShowDefault={4}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations,membershipOrgIds,onlyShowCurrent,onlyShowDefault);
            return await restClient.AtUrl(urlTemplate).Get<MembershipDetails>();
        }

        /// 
        public async Task<RestResponse<CalculateMembershipResponse>> Calculate(CalculateMembershipRequest calculateMembershipRequest)
        {
            return await restClient.AtUrl("CRM/Memberships/Calculate").Post<CalculateMembershipRequest, CalculateMembershipResponse>(calculateMembershipRequest);
        }

    }
 

 
    /// 
    public class MembershipsFacadeBatch
    {
        private IRestClient restClient;

        public MembershipsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(string constituentId, Boolean? includeAffiliations = null, string membershipOrgIds = "null", Boolean? onlyShowCurrent = null, Boolean? onlyShowDefault = null, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MembershipDetails";
            bRequest.Content = null;

            var urlTemplate = "CRM/Memberships/Details?constituentId={0}&includeAffiliations={1}&membershipOrgIds={2}&onlyShowCurrent={3}&onlyShowDefault={4}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations,membershipOrgIds,onlyShowCurrent,onlyShowDefault);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Calculate(CalculateMembershipRequest calculateMembershipRequest, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CalculateMembershipResponse";
            bRequest.Content = calculateMembershipRequest;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/Memberships/Calculate";

            return bRequest;
        }

    }
 

 
    /// 
    public class PackageHistoryFacade
    {
        private IRestClient restClient;

        public PackageHistoryFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Gets history information for packages
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="seasonId"></param>
        /// <param name="packageId"></param>
        /// <param name="packageTypeId"></param>
        /// <param name="orderStartDate"></param>
        /// <param name="orderEndDate"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public async Task<RestResponse<PackageHistories>> GetAll(string constituentId = "null", string seasonId = "null", string packageId = "null", string packageTypeId = "null", string orderStartDate = "null", string orderEndDate = "null", string includeAffiliations = "null")
        {
            var urlTemplate = "CRM/PackageHistory/?constituentId={0}&seasonId={1}&packageId={2}&packageTypeId={3}&orderStartDate={4}&orderEndDate={5}&includeAffiliations={6}";
            urlTemplate = string.Format(urlTemplate, constituentId,seasonId,packageId,packageTypeId,orderStartDate,orderEndDate,includeAffiliations);
            return await restClient.AtUrl(urlTemplate).Get<PackageHistories>();
        }

    }
 

 
    /// 
    public class PackageHistoryFacadeBatch
    {
        private IRestClient restClient;

        public PackageHistoryFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Gets history information for packages
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="seasonId"></param>
        /// <param name="packageId"></param>
        /// <param name="packageTypeId"></param>
        /// <param name="orderStartDate"></param>
        /// <param name="orderEndDate"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public Request GetAll(string constituentId = "null", string seasonId = "null", string packageId = "null", string packageTypeId = "null", string orderStartDate = "null", string orderEndDate = "null", string includeAffiliations = "null", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PackageHistories";
            bRequest.Content = null;

            var urlTemplate = "CRM/PackageHistory/?constituentId={0}&seasonId={1}&packageId={2}&packageTypeId={3}&orderStartDate={4}&orderEndDate={5}&includeAffiliations={6}";
            urlTemplate = string.Format(urlTemplate, constituentId,seasonId,packageId,packageTypeId,orderStartDate,orderEndDate,includeAffiliations);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PhonesFacade
    {
        private IRestClient restClient;

        public PhonesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the phones for the specified constituent (constituentId) and all its visible affiliation's phones as well or address (addressId). To exclude phones of the visible affiliations pass includeAffiliations=\"false\". If addressId is passed, constituentId or includeAffiliations parameters are ignored. To Get the phones attached to the primary address pass primary=\"true\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <param name="addressId"></param>
        /// <param name="primaryOnly"></param>
        /// <returns></returns>
        public async Task<RestResponse<Phones>> GetAll(string constituentId = "", string includeAffiliations = "", string addressId = "", string primaryOnly = "")
        {
            var urlTemplate = "CRM/Phones/?constituentId={0}&includeAffiliations={1}&addressId={2}&primaryOnly={3}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations,addressId,primaryOnly);
            return await restClient.AtUrl(urlTemplate).Get<Phones>();
        }

        /// <summary>
        /// Get details of a phone.
        /// </summary>
        /// <param name="phoneId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Phone>> Get(string phoneId = "")
        {
             var urlTemplate = "CRM/Phones/{0}";
             urlTemplate = string.Format(urlTemplate, phoneId);
            return await restClient.AtUrl(urlTemplate).Get<Phone>();
        }

        /// <summary>
        /// Create a new phone.
        /// </summary>
        /// <param name="phone"></param>
        /// <returns></returns>
        public async Task<RestResponse<Phone>> Create(Phone phone)
        {
            return await restClient.AtUrl("CRM/Phones/").Post<Phone, Phone>(phone);
        }

        /// <summary>
        /// Update a phone.
        /// </summary>
        /// <param name="phoneId"></param>
        /// <param name="phone"></param>
        /// <returns></returns>
        public async Task<RestResponse<Phone>> Update(string phoneId, Phone phone)
        {
             var urlTemplate = "CRM/Phones/{0}";
             urlTemplate = string.Format(urlTemplate, phoneId);
            return await restClient.AtUrl(urlTemplate).Put<Phone, Phone>(phone);
        }

        /// <summary>
        /// Delete a phone.
        /// </summary>
        /// <param name="phoneId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string phoneId)
        {
             var urlTemplate = "CRM/Phones/{0}";
             urlTemplate = string.Format(urlTemplate, phoneId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PhonesFacadeBatch
    {
        private IRestClient restClient;

        public PhonesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the phones for the specified constituent (constituentId) and all its visible affiliation's phones as well or address (addressId). To exclude phones of the visible affiliations pass includeAffiliations=\"false\". If addressId is passed, constituentId or includeAffiliations parameters are ignored. To Get the phones attached to the primary address pass primary=\"true\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <param name="addressId"></param>
        /// <param name="primaryOnly"></param>
        /// <returns></returns>
        public Request GetAll(string constituentId = "", string includeAffiliations = "", string addressId = "", string primaryOnly = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Phones";
            bRequest.Content = null;

            var urlTemplate = "CRM/Phones/?constituentId={0}&includeAffiliations={1}&addressId={2}&primaryOnly={3}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations,addressId,primaryOnly);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a phone.
        /// </summary>
        /// <param name="phoneId"></param>
        /// <returns></returns>
        public Request Get(string phoneId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Phone";
            bRequest.Content = null;

            var urlTemplate = "CRM/Phones/{0}";
            urlTemplate = string.Format(urlTemplate, phoneId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new phone.
        /// </summary>
        /// <param name="phone"></param>
        /// <returns></returns>
        public Request Create(Phone phone, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Phone";
            bRequest.Content = phone;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/Phones/";

            return bRequest;
        }

        /// <summary>
        /// Update a phone.
        /// </summary>
        /// <param name="phoneId"></param>
        /// <param name="phone"></param>
        /// <returns></returns>
        public Request Update(string phoneId, Phone phone, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Phone";
            bRequest.Content = phone;

            var urlTemplate = "CRM/Phones/{0}";
            urlTemplate = string.Format(urlTemplate, phoneId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete a phone.
        /// </summary>
        /// <param name="phoneId"></param>
        public Request Delete(string phoneId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "CRM/Phones/{0}";
            urlTemplate = string.Format(urlTemplate, phoneId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ProgramListingsFacade
    {
        private IRestClient restClient;

        public ProgramListingsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the program listings for the specified constituent id and all its visible affiliation's program listings as well. To exclude program listings of the visible affiliations pass includeAffiliations=\"false\". To Get The primary program listings alone, pass primaryOnly=\"true\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public async Task<RestResponse<ProgramListings>> GetAll(string constituentId = "", string includeAffiliations = "")
        {
            var urlTemplate = "CRM/ProgramListings/?constituentId={0}&includeAffiliations={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations);
            return await restClient.AtUrl(urlTemplate).Get<ProgramListings>();
        }

        /// <summary>
        /// Get details of a program listing.
        /// </summary>
        /// <param name="programListingId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ProgramListing>> Get(string programListingId = "")
        {
             var urlTemplate = "CRM/ProgramListings/{0}";
             urlTemplate = string.Format(urlTemplate, programListingId);
            return await restClient.AtUrl(urlTemplate).Get<ProgramListing>();
        }

        /// <summary>
        /// Create a new program listing.
        /// </summary>
        /// <param name="programListing"></param>
        /// <returns></returns>
        public async Task<RestResponse<ProgramListing>> Create(ProgramListing programListing)
        {
            return await restClient.AtUrl("CRM/ProgramListings/").Post<ProgramListing, ProgramListing>(programListing);
        }

        /// <summary>
        /// Update a program listing.
        /// </summary>
        /// <param name="programListingId"></param>
        /// <param name="programListing"></param>
        /// <returns></returns>
        public async Task<RestResponse<ProgramListing>> Update(string programListingId, ProgramListing programListing)
        {
             var urlTemplate = "CRM/ProgramListings/{0}";
             urlTemplate = string.Format(urlTemplate, programListingId);
            return await restClient.AtUrl(urlTemplate).Put<ProgramListing, ProgramListing>(programListing);
        }

        /// <summary>
        /// Delete a program listing.
        /// </summary>
        /// <param name="programListingId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string programListingId)
        {
             var urlTemplate = "CRM/ProgramListings/{0}";
             urlTemplate = string.Format(urlTemplate, programListingId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ProgramListingsFacadeBatch
    {
        private IRestClient restClient;

        public ProgramListingsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the program listings for the specified constituent id and all its visible affiliation's program listings as well. To exclude program listings of the visible affiliations pass includeAffiliations=\"false\". To Get The primary program listings alone, pass primaryOnly=\"true\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public Request GetAll(string constituentId = "", string includeAffiliations = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ProgramListings";
            bRequest.Content = null;

            var urlTemplate = "CRM/ProgramListings/?constituentId={0}&includeAffiliations={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a program listing.
        /// </summary>
        /// <param name="programListingId"></param>
        /// <returns></returns>
        public Request Get(string programListingId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ProgramListing";
            bRequest.Content = null;

            var urlTemplate = "CRM/ProgramListings/{0}";
            urlTemplate = string.Format(urlTemplate, programListingId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new program listing.
        /// </summary>
        /// <param name="programListing"></param>
        /// <returns></returns>
        public Request Create(ProgramListing programListing, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ProgramListing";
            bRequest.Content = programListing;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/ProgramListings/";

            return bRequest;
        }

        /// <summary>
        /// Update a program listing.
        /// </summary>
        /// <param name="programListingId"></param>
        /// <param name="programListing"></param>
        /// <returns></returns>
        public Request Update(string programListingId, ProgramListing programListing, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ProgramListing";
            bRequest.Content = programListing;

            var urlTemplate = "CRM/ProgramListings/{0}";
            urlTemplate = string.Format(urlTemplate, programListingId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete a program listing.
        /// </summary>
        /// <param name="programListingId"></param>
        public Request Delete(string programListingId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "CRM/ProgramListings/{0}";
            urlTemplate = string.Format(urlTemplate, programListingId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class RankingsFacade
    {
        private IRestClient restClient;

        public RankingsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the rankings for the specified constituent id and all its visible affiliation's rankings as well. To exclude rankings of the visible affiliations pass includeAffiliations=\"false\". To Get The primary rankings alone, pass primaryOnly=\"true\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public async Task<RestResponse<Rankings>> GetAll(string constituentId = "", string includeAffiliations = "")
        {
            var urlTemplate = "CRM/Rankings/?constituentId={0}&includeAffiliations={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations);
            return await restClient.AtUrl(urlTemplate).Get<Rankings>();
        }

        /// <summary>
        /// Get details of a ranking.
        /// </summary>
        /// <param name="rankingId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Ranking>> Get(string rankingId = "")
        {
             var urlTemplate = "CRM/Rankings/{0}";
             urlTemplate = string.Format(urlTemplate, rankingId);
            return await restClient.AtUrl(urlTemplate).Get<Ranking>();
        }

        /// <summary>
        /// Create a new ranking.
        /// </summary>
        /// <param name="ranking"></param>
        /// <returns></returns>
        public async Task<RestResponse<Ranking>> Create(Ranking ranking)
        {
            return await restClient.AtUrl("CRM/Rankings/").Post<Ranking, Ranking>(ranking);
        }

        /// <summary>
        /// Update a ranking.
        /// </summary>
        /// <param name="rankingId"></param>
        /// <param name="ranking"></param>
        /// <returns></returns>
        public async Task<RestResponse<Ranking>> Update(string rankingId, Ranking ranking)
        {
             var urlTemplate = "CRM/Rankings/{0}";
             urlTemplate = string.Format(urlTemplate, rankingId);
            return await restClient.AtUrl(urlTemplate).Put<Ranking, Ranking>(ranking);
        }

        /// <summary>
        /// Delete a ranking.
        /// </summary>
        /// <param name="rankingId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string rankingId)
        {
             var urlTemplate = "CRM/Rankings/{0}";
             urlTemplate = string.Format(urlTemplate, rankingId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class RankingsFacadeBatch
    {
        private IRestClient restClient;

        public RankingsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the rankings for the specified constituent id and all its visible affiliation's rankings as well. To exclude rankings of the visible affiliations pass includeAffiliations=\"false\". To Get The primary rankings alone, pass primaryOnly=\"true\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public Request GetAll(string constituentId = "", string includeAffiliations = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Rankings";
            bRequest.Content = null;

            var urlTemplate = "CRM/Rankings/?constituentId={0}&includeAffiliations={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a ranking.
        /// </summary>
        /// <param name="rankingId"></param>
        /// <returns></returns>
        public Request Get(string rankingId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Ranking";
            bRequest.Content = null;

            var urlTemplate = "CRM/Rankings/{0}";
            urlTemplate = string.Format(urlTemplate, rankingId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new ranking.
        /// </summary>
        /// <param name="ranking"></param>
        /// <returns></returns>
        public Request Create(Ranking ranking, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Ranking";
            bRequest.Content = ranking;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/Rankings/";

            return bRequest;
        }

        /// <summary>
        /// Update a ranking.
        /// </summary>
        /// <param name="rankingId"></param>
        /// <param name="ranking"></param>
        /// <returns></returns>
        public Request Update(string rankingId, Ranking ranking, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Ranking";
            bRequest.Content = ranking;

            var urlTemplate = "CRM/Rankings/{0}";
            urlTemplate = string.Format(urlTemplate, rankingId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete a ranking.
        /// </summary>
        /// <param name="rankingId"></param>
        public Request Delete(string rankingId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "CRM/Rankings/{0}";
            urlTemplate = string.Format(urlTemplate, rankingId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class RelationshipsFacade
    {
        private IRestClient restClient;

        public RelationshipsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all affiliations and associations of the specified constituent id or get all affiliations and associations of the specified associated constituent id. If both are specified get all the associations and affiliations between them.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="associatedConstituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <param name="startActiveDate"></param>
        /// <param name="endActiveDate"></param>
        /// <param name="activeOnly"></param>
        /// <returns></returns>
        public async Task<RestResponse<Relationships>> GetAll(string constituentId = "", string associatedConstituentId = "", string includeAffiliations = "", string startActiveDate = "", string endActiveDate = "", string activeOnly = "")
        {
            var urlTemplate = "CRM/Relationships/?constituentId={0}&associatedConstituentId={1}&includeAffiliations={2}&startActiveDate={3}&endActiveDate={4}&activeOnly={5}";
            urlTemplate = string.Format(urlTemplate, constituentId,associatedConstituentId,includeAffiliations,startActiveDate,endActiveDate,activeOnly);
            return await restClient.AtUrl(urlTemplate).Get<Relationships>();
        }

    }
 

 
    /// 
    public class RelationshipsFacadeBatch
    {
        private IRestClient restClient;

        public RelationshipsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all affiliations and associations of the specified constituent id or get all affiliations and associations of the specified associated constituent id. If both are specified get all the associations and affiliations between them.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="associatedConstituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <param name="startActiveDate"></param>
        /// <param name="endActiveDate"></param>
        /// <param name="activeOnly"></param>
        /// <returns></returns>
        public Request GetAll(string constituentId = "", string associatedConstituentId = "", string includeAffiliations = "", string startActiveDate = "", string endActiveDate = "", string activeOnly = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Relationships";
            bRequest.Content = null;

            var urlTemplate = "CRM/Relationships/?constituentId={0}&associatedConstituentId={1}&includeAffiliations={2}&startActiveDate={3}&endActiveDate={4}&activeOnly={5}";
            urlTemplate = string.Format(urlTemplate, constituentId,associatedConstituentId,includeAffiliations,startActiveDate,endActiveDate,activeOnly);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class SalutationsFacade
    {
        private IRestClient restClient;

        public SalutationsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the salutations for the specified constituent id and all its visible affiliation's salutations as well. To exclude salutations of the visible affiliations pass includeAffiliations=\"false\".To fetch default salutations alone pass defaultOnly=\"true\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <param name="defaultOnly"></param>
        /// <param name="includeFromAffiliations"></param>
        /// <returns></returns>
        public async Task<RestResponse<Salutations>> GetAll(string constituentId = "", string includeAffiliations = "", string defaultOnly = "", string includeFromAffiliations = "")
        {
            var urlTemplate = "CRM/Salutations/?constituentId={0}&includeAffiliations={1}&defaultOnly={2}&includeFromAffiliations={3}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations,defaultOnly,includeFromAffiliations);
            return await restClient.AtUrl(urlTemplate).Get<Salutations>();
        }

        /// <summary>
        /// Get details of a salutation.
        /// </summary>
        /// <param name="salutationId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Salutation>> Get(string salutationId = "")
        {
             var urlTemplate = "CRM/Salutations/{0}";
             urlTemplate = string.Format(urlTemplate, salutationId);
            return await restClient.AtUrl(urlTemplate).Get<Salutation>();
        }

        /// <summary>
        /// Create a new salutation.
        /// </summary>
        /// <param name="salutation"></param>
        /// <returns></returns>
        public async Task<RestResponse<Salutation>> Create(Salutation salutation)
        {
            return await restClient.AtUrl("CRM/Salutations/").Post<Salutation, Salutation>(salutation);
        }

        /// <summary>
        /// Update a salutation.
        /// </summary>
        /// <param name="salutationId"></param>
        /// <param name="salutation"></param>
        /// <returns></returns>
        public async Task<RestResponse<Salutation>> Update(string salutationId, Salutation salutation)
        {
             var urlTemplate = "CRM/Salutations/{0}";
             urlTemplate = string.Format(urlTemplate, salutationId);
            return await restClient.AtUrl(urlTemplate).Put<Salutation, Salutation>(salutation);
        }

        /// <summary>
        /// Delete a salutation.
        /// </summary>
        /// <param name="salutationId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string salutationId)
        {
             var urlTemplate = "CRM/Salutations/{0}";
             urlTemplate = string.Format(urlTemplate, salutationId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Generates values for the fields required for the salutation, last name and sort name using the values passed as query parameters. If you pass in value for 'constituentId' there is no need to pass values for any other parameters. Even if it is passed they are ignored. If value for constituentId is not passed, values for other parameters should be passed. In this case values for either 'constituentTypeId' or 'formulaId' should be passed.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="constituentTypeId"></param>
        /// <param name="formulaId"></param>
        /// <param name="maxLength"></param>
        /// <param name="fname1"></param>
        /// <param name="mname1"></param>
        /// <param name="lname1"></param>
        /// <param name="prefix1"></param>
        /// <param name="suffix1"></param>
        /// <param name="status1"></param>
        /// <param name="gender1"></param>
        /// <param name="fname2"></param>
        /// <param name="mname2"></param>
        /// <param name="lname2"></param>
        /// <param name="prefix2"></param>
        /// <param name="suffix2"></param>
        /// <param name="status2"></param>
        /// <param name="gender2"></param>
        /// <param name="lnameGroup"></param>
        /// <returns></returns>
        public async Task<RestResponse<SalutationResponse>> Generate(string constituentId = "", string constituentTypeId = "", string formulaId = "", string maxLength = "", string fname1 = "", string mname1 = "", string lname1 = "", string prefix1 = "", string suffix1 = "", string status1 = "", string gender1 = "", string fname2 = "", string mname2 = "", string lname2 = "", string prefix2 = "", string suffix2 = "", string status2 = "", string gender2 = "", string lnameGroup = "")
        {
            var urlTemplate = "CRM/Salutations/Generate/?constituentId={0}&constituentTypeId={1}&formulaId={2}&maxLength={3}&fname1={4}&mname1={5}&lname1={6}&prefix1={7}&suffix1={8}&status1={9}&gender1={10}&fname2={11}&mname2={12}&lname2={13}&prefix2={14}&suffix2={15}&status2={16}&gender2={17}&lnameGroup={18}";
            urlTemplate = string.Format(urlTemplate, constituentId,constituentTypeId,formulaId,maxLength,fname1,mname1,lname1,prefix1,suffix1,status1,gender1,fname2,mname2,lname2,prefix2,suffix2,status2,gender2,lnameGroup);
            return await restClient.AtUrl(urlTemplate).Get<SalutationResponse>();
        }

    }
 

 
    /// 
    public class SalutationsFacadeBatch
    {
        private IRestClient restClient;

        public SalutationsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the salutations for the specified constituent id and all its visible affiliation's salutations as well. To exclude salutations of the visible affiliations pass includeAffiliations=\"false\".To fetch default salutations alone pass defaultOnly=\"true\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <param name="defaultOnly"></param>
        /// <param name="includeFromAffiliations"></param>
        /// <returns></returns>
        public Request GetAll(string constituentId = "", string includeAffiliations = "", string defaultOnly = "", string includeFromAffiliations = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Salutations";
            bRequest.Content = null;

            var urlTemplate = "CRM/Salutations/?constituentId={0}&includeAffiliations={1}&defaultOnly={2}&includeFromAffiliations={3}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations,defaultOnly,includeFromAffiliations);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a salutation.
        /// </summary>
        /// <param name="salutationId"></param>
        /// <returns></returns>
        public Request Get(string salutationId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Salutation";
            bRequest.Content = null;

            var urlTemplate = "CRM/Salutations/{0}";
            urlTemplate = string.Format(urlTemplate, salutationId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new salutation.
        /// </summary>
        /// <param name="salutation"></param>
        /// <returns></returns>
        public Request Create(Salutation salutation, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Salutation";
            bRequest.Content = salutation;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/Salutations/";

            return bRequest;
        }

        /// <summary>
        /// Update a salutation.
        /// </summary>
        /// <param name="salutationId"></param>
        /// <param name="salutation"></param>
        /// <returns></returns>
        public Request Update(string salutationId, Salutation salutation, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Salutation";
            bRequest.Content = salutation;

            var urlTemplate = "CRM/Salutations/{0}";
            urlTemplate = string.Format(urlTemplate, salutationId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete a salutation.
        /// </summary>
        /// <param name="salutationId"></param>
        public Request Delete(string salutationId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "CRM/Salutations/{0}";
            urlTemplate = string.Format(urlTemplate, salutationId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Generates values for the fields required for the salutation, last name and sort name using the values passed as query parameters. If you pass in value for 'constituentId' there is no need to pass values for any other parameters. Even if it is passed they are ignored. If value for constituentId is not passed, values for other parameters should be passed. In this case values for either 'constituentTypeId' or 'formulaId' should be passed.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="constituentTypeId"></param>
        /// <param name="formulaId"></param>
        /// <param name="maxLength"></param>
        /// <param name="fname1"></param>
        /// <param name="mname1"></param>
        /// <param name="lname1"></param>
        /// <param name="prefix1"></param>
        /// <param name="suffix1"></param>
        /// <param name="status1"></param>
        /// <param name="gender1"></param>
        /// <param name="fname2"></param>
        /// <param name="mname2"></param>
        /// <param name="lname2"></param>
        /// <param name="prefix2"></param>
        /// <param name="suffix2"></param>
        /// <param name="status2"></param>
        /// <param name="gender2"></param>
        /// <param name="lnameGroup"></param>
        /// <returns></returns>
        public Request Generate(string constituentId = "", string constituentTypeId = "", string formulaId = "", string maxLength = "", string fname1 = "", string mname1 = "", string lname1 = "", string prefix1 = "", string suffix1 = "", string status1 = "", string gender1 = "", string fname2 = "", string mname2 = "", string lname2 = "", string prefix2 = "", string suffix2 = "", string status2 = "", string gender2 = "", string lnameGroup = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SalutationResponse";
            bRequest.Content = null;

            var urlTemplate = "CRM/Salutations/Generate/?constituentId={0}&constituentTypeId={1}&formulaId={2}&maxLength={3}&fname1={4}&mname1={5}&lname1={6}&prefix1={7}&suffix1={8}&status1={9}&gender1={10}&fname2={11}&mname2={12}&lname2={13}&prefix2={14}&suffix2={15}&status2={16}&gender2={17}&lnameGroup={18}";
            urlTemplate = string.Format(urlTemplate, constituentId,constituentTypeId,formulaId,maxLength,fname1,mname1,lname1,prefix1,suffix1,status1,gender1,fname2,mname2,lname2,prefix2,suffix2,status2,gender2,lnameGroup);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class SpecialActivitiesFacade
    {
        private IRestClient restClient;

        public SpecialActivitiesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<SpecialActivities>> GetAll(string constituentId = "", string includeAffiliations = "")
        {
            var urlTemplate = "CRM/SpecialActivities/?constituentId={0}&includeAffiliations={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations);
            return await restClient.AtUrl(urlTemplate).Get<SpecialActivities>();
        }

        /// 
        public async Task<RestResponse<SpecialActivity>> Get(string specialActivityId)
        {
             var urlTemplate = "CRM/SpecialActivities/{0}";
             urlTemplate = string.Format(urlTemplate, specialActivityId);
            return await restClient.AtUrl(urlTemplate).Get<SpecialActivity>();
        }

        /// 
        public async Task<RestResponse<SpecialActivity>> Create(SpecialActivity specialActivity)
        {
            return await restClient.AtUrl("CRM/SpecialActivities/").Post<SpecialActivity, SpecialActivity>(specialActivity);
        }

        /// 
        public async Task<RestResponse<SpecialActivity>> Update(string specialActivityId, SpecialActivity specialActivity)
        {
             var urlTemplate = "CRM/SpecialActivities/{0}";
             urlTemplate = string.Format(urlTemplate, specialActivityId);
            return await restClient.AtUrl(urlTemplate).Put<SpecialActivity, SpecialActivity>(specialActivity);
        }

        /// 
        public async Task<RestResponse<NoResponse>> Delete(string specialActivityId)
        {
             var urlTemplate = "CRM/SpecialActivities/{0}";
             urlTemplate = string.Format(urlTemplate, specialActivityId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class SpecialActivitiesFacadeBatch
    {
        private IRestClient restClient;

        public SpecialActivitiesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(string constituentId = "", string includeAffiliations = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SpecialActivities";
            bRequest.Content = null;

            var urlTemplate = "CRM/SpecialActivities/?constituentId={0}&includeAffiliations={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Get(string specialActivityId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SpecialActivity";
            bRequest.Content = null;

            var urlTemplate = "CRM/SpecialActivities/{0}";
            urlTemplate = string.Format(urlTemplate, specialActivityId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Create(SpecialActivity specialActivity, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SpecialActivity";
            bRequest.Content = specialActivity;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/SpecialActivities/";

            return bRequest;
        }

        /// 
        public Request Update(string specialActivityId, SpecialActivity specialActivity, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SpecialActivity";
            bRequest.Content = specialActivity;

            var urlTemplate = "CRM/SpecialActivities/{0}";
            urlTemplate = string.Format(urlTemplate, specialActivityId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Delete(string specialActivityId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "CRM/SpecialActivities/{0}";
            urlTemplate = string.Format(urlTemplate, specialActivityId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class TicketHistoryFacade
    {
        private IRestClient restClient;

        public TicketHistoryFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Gets history information for tickets
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="seasonId"></param>
        /// <param name="productionSeasonId"></param>
        /// <param name="performanceId"></param>
        /// <param name="performanceStartDate"></param>
        /// <param name="performanceEndDate"></param>
        /// <param name="orderStartDate"></param>
        /// <param name="orderEndDate"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public async Task<RestResponse<TicketHistories>> GetAll(string constituentId = "null", string seasonId = "null", string productionSeasonId = "null", string performanceId = "null", string performanceStartDate = "null", string performanceEndDate = "null", string orderStartDate = "null", string orderEndDate = "null", string includeAffiliations = "null")
        {
            var urlTemplate = "CRM/TicketHistory/?constituentId={0}&seasonId={1}&productionSeasonId={2}&performanceId={3}&performanceStartDate={4}&performanceEndDate={5}&orderStartDate={6}&orderEndDate={7}&includeAffiliations={8}";
            urlTemplate = string.Format(urlTemplate, constituentId,seasonId,productionSeasonId,performanceId,performanceStartDate,performanceEndDate,orderStartDate,orderEndDate,includeAffiliations);
            return await restClient.AtUrl(urlTemplate).Get<TicketHistories>();
        }

    }
 

 
    /// 
    public class TicketHistoryFacadeBatch
    {
        private IRestClient restClient;

        public TicketHistoryFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Gets history information for tickets
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="seasonId"></param>
        /// <param name="productionSeasonId"></param>
        /// <param name="performanceId"></param>
        /// <param name="performanceStartDate"></param>
        /// <param name="performanceEndDate"></param>
        /// <param name="orderStartDate"></param>
        /// <param name="orderEndDate"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public Request GetAll(string constituentId = "null", string seasonId = "null", string productionSeasonId = "null", string performanceId = "null", string performanceStartDate = "null", string performanceEndDate = "null", string orderStartDate = "null", string orderEndDate = "null", string includeAffiliations = "null", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TicketHistories";
            bRequest.Content = null;

            var urlTemplate = "CRM/TicketHistory/?constituentId={0}&seasonId={1}&productionSeasonId={2}&performanceId={3}&performanceStartDate={4}&performanceEndDate={5}&orderStartDate={6}&orderEndDate={7}&includeAffiliations={8}";
            urlTemplate = string.Format(urlTemplate, constituentId,seasonId,productionSeasonId,performanceId,performanceStartDate,performanceEndDate,orderStartDate,orderEndDate,includeAffiliations);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class WebLoginsFacade
    {
        private IRestClient restClient;

        public WebLoginsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the weblogins for the specified constituent id and all its visible affiliation's weblogins as well. To exclude weblogins of the visible affiliations pass includeAffiliations=\"false\". To fetch primary web logins alone pass primaryOnly=\"true\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <param name="primaryOnly"></param>
        /// <returns></returns>
        public async Task<RestResponse<WebLogins>> GetAll(string constituentId = "", string includeAffiliations = "", string primaryOnly = "")
        {
            var urlTemplate = "CRM/WebLogins/?constituentId={0}&includeAffiliations={1}&primaryOnly={2}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations,primaryOnly);
            return await restClient.AtUrl(urlTemplate).Get<WebLogins>();
        }

        /// <summary>
        /// Get weblogins by email address and login type
        /// </summary>
        /// <param name="emailAddress"></param>
        /// <param name="loginTypeId"></param>
        public async Task<RestResponse<WebLogins>> Search(string emailAddress, string loginTypeId)
        {
            var urlTemplate = "CRM/WebLogins/Search?emailAddress={0}&loginTypeId={1}";
            urlTemplate = string.Format(urlTemplate, emailAddress,loginTypeId);
            return await restClient.AtUrl(urlTemplate).Get<WebLogins>();
        }

        /// <summary>
        /// Get details of a weblogin.
        /// </summary>
        /// <param name="webLoginId"></param>
        /// <returns></returns>
        public async Task<RestResponse<WebLogin>> Get(string webLoginId = "")
        {
             var urlTemplate = "CRM/WebLogins/{0}";
             urlTemplate = string.Format(urlTemplate, webLoginId);
            return await restClient.AtUrl(urlTemplate).Get<WebLogin>();
        }

        /// <summary>
        /// Create a new weblogin.
        /// </summary>
        /// <param name="login"></param>
        /// <returns></returns>
        public async Task<RestResponse<WebLogin>> Create(WebLogin login)
        {
            return await restClient.AtUrl("CRM/WebLogins/").Post<WebLogin, WebLogin>(login);
        }

        /// <summary>
        /// Update a weblogin.
        /// </summary>
        /// <param name="loginId"></param>
        /// <param name="login"></param>
        /// <returns></returns>
        public async Task<RestResponse<WebLogin>> Update(string loginId, WebLogin login)
        {
             var urlTemplate = "CRM/WebLogins/{0}";
             urlTemplate = string.Format(urlTemplate, loginId);
            return await restClient.AtUrl(urlTemplate).Put<WebLogin, WebLogin>(login);
        }

        /// <summary>
        /// Delete a weblogin.
        /// </summary>
        /// <param name="loginId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string loginId)
        {
             var urlTemplate = "CRM/WebLogins/{0}";
             urlTemplate = string.Format(urlTemplate, loginId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Returns web login credential information
        /// </summary>
        /// <param name="loginId"></param>
        /// <returns></returns>
        public async Task<RestResponse<LoginCredentials>> GetLoginCredentials(string loginId)
        {
             var urlTemplate = "CRM/WebLogins/{0}/LoginCredentials";
             urlTemplate = string.Format(urlTemplate, loginId);
            return await restClient.AtUrl(urlTemplate).Get<LoginCredentials>();
        }

    }
 

 
    /// 
    public class WebLoginsFacadeBatch
    {
        private IRestClient restClient;

        public WebLoginsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the weblogins for the specified constituent id and all its visible affiliation's weblogins as well. To exclude weblogins of the visible affiliations pass includeAffiliations=\"false\". To fetch primary web logins alone pass primaryOnly=\"true\".
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <param name="primaryOnly"></param>
        /// <returns></returns>
        public Request GetAll(string constituentId = "", string includeAffiliations = "", string primaryOnly = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WebLogins";
            bRequest.Content = null;

            var urlTemplate = "CRM/WebLogins/?constituentId={0}&includeAffiliations={1}&primaryOnly={2}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations,primaryOnly);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get weblogins by email address and login type
        /// </summary>
        /// <param name="emailAddress"></param>
        /// <param name="loginTypeId"></param>
        public Request Search(string emailAddress, string loginTypeId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WebLogins";
            bRequest.Content = null;

            var urlTemplate = "CRM/WebLogins/Search?emailAddress={0}&loginTypeId={1}";
            urlTemplate = string.Format(urlTemplate, emailAddress,loginTypeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a weblogin.
        /// </summary>
        /// <param name="webLoginId"></param>
        /// <returns></returns>
        public Request Get(string webLoginId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WebLogin";
            bRequest.Content = null;

            var urlTemplate = "CRM/WebLogins/{0}";
            urlTemplate = string.Format(urlTemplate, webLoginId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new weblogin.
        /// </summary>
        /// <param name="login"></param>
        /// <returns></returns>
        public Request Create(WebLogin login, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WebLogin";
            bRequest.Content = login;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/WebLogins/";

            return bRequest;
        }

        /// <summary>
        /// Update a weblogin.
        /// </summary>
        /// <param name="loginId"></param>
        /// <param name="login"></param>
        /// <returns></returns>
        public Request Update(string loginId, WebLogin login, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WebLogin";
            bRequest.Content = login;

            var urlTemplate = "CRM/WebLogins/{0}";
            urlTemplate = string.Format(urlTemplate, loginId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete a weblogin.
        /// </summary>
        /// <param name="loginId"></param>
        public Request Delete(string loginId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "CRM/WebLogins/{0}";
            urlTemplate = string.Format(urlTemplate, loginId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Returns web login credential information
        /// </summary>
        /// <param name="loginId"></param>
        /// <returns></returns>
        public Request GetLoginCredentials(string loginId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.LoginCredentials";
            bRequest.Content = null;

            var urlTemplate = "CRM/WebLogins/{0}/LoginCredentials";
            urlTemplate = string.Format(urlTemplate, loginId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class WorkerQualificationsFacade
    {
        private IRestClient restClient;

        public WorkerQualificationsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all WorkerQualifications for a constituent, optionally including qualifications from affiliated constituents.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public async Task<RestResponse<WorkerQualifications>> GetAll(string constituentId = "", string includeAffiliations = "")
        {
            var urlTemplate = "CRM/WorkerQualifications/?constituentId={0}&includeAffiliations={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations);
            return await restClient.AtUrl(urlTemplate).Get<WorkerQualifications>();
        }

        /// <summary>
        /// Get a single WorkerQualification by Id.
        /// </summary>
        /// <param name="workerQualificationId"></param>
        /// <returns></returns>
        public async Task<RestResponse<WorkerQualification>> Get(string workerQualificationId)
        {
             var urlTemplate = "CRM/WorkerQualifications/{0}";
             urlTemplate = string.Format(urlTemplate, workerQualificationId);
            return await restClient.AtUrl(urlTemplate).Get<WorkerQualification>();
        }

        /// <summary>
        /// Create a WorkerQualification.
        /// </summary>
        /// <param name="workerQualification"></param>
        /// <returns></returns>
        public async Task<RestResponse<WorkerQualification>> Create(WorkerQualification workerQualification)
        {
            return await restClient.AtUrl("CRM/WorkerQualifications/").Post<WorkerQualification, WorkerQualification>(workerQualification);
        }

        /// <summary>
        /// Update an existing WorkerQualification.
        /// </summary>
        /// <param name="workerQualificationId"></param>
        /// <param name="workerQualification"></param>
        /// <returns></returns>
        public async Task<RestResponse<WorkerQualification>> Update(string workerQualificationId, WorkerQualification workerQualification)
        {
             var urlTemplate = "CRM/WorkerQualifications/{0}";
             urlTemplate = string.Format(urlTemplate, workerQualificationId);
            return await restClient.AtUrl(urlTemplate).Put<WorkerQualification, WorkerQualification>(workerQualification);
        }

        /// <summary>
        /// Delete an existing WorkerQualification.
        /// </summary>
        /// <param name="workerQualificationId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string workerQualificationId)
        {
             var urlTemplate = "CRM/WorkerQualifications/{0}";
             urlTemplate = string.Format(urlTemplate, workerQualificationId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class WorkerQualificationsFacadeBatch
    {
        private IRestClient restClient;

        public WorkerQualificationsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all WorkerQualifications for a constituent, optionally including qualifications from affiliated constituents.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public Request GetAll(string constituentId = "", string includeAffiliations = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WorkerQualifications";
            bRequest.Content = null;

            var urlTemplate = "CRM/WorkerQualifications/?constituentId={0}&includeAffiliations={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get a single WorkerQualification by Id.
        /// </summary>
        /// <param name="workerQualificationId"></param>
        /// <returns></returns>
        public Request Get(string workerQualificationId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WorkerQualification";
            bRequest.Content = null;

            var urlTemplate = "CRM/WorkerQualifications/{0}";
            urlTemplate = string.Format(urlTemplate, workerQualificationId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a WorkerQualification.
        /// </summary>
        /// <param name="workerQualification"></param>
        /// <returns></returns>
        public Request Create(WorkerQualification workerQualification, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WorkerQualification";
            bRequest.Content = workerQualification;

            bRequest.Uri = restClient.GetBaseUrl() + "CRM/WorkerQualifications/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing WorkerQualification.
        /// </summary>
        /// <param name="workerQualificationId"></param>
        /// <param name="workerQualification"></param>
        /// <returns></returns>
        public Request Update(string workerQualificationId, WorkerQualification workerQualification, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WorkerQualification";
            bRequest.Content = workerQualification;

            var urlTemplate = "CRM/WorkerQualifications/{0}";
            urlTemplate = string.Format(urlTemplate, workerQualificationId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing WorkerQualification.
        /// </summary>
        /// <param name="workerQualificationId"></param>
        public Request Delete(string workerQualificationId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "CRM/WorkerQualifications/{0}";
            urlTemplate = string.Format(urlTemplate, workerQualificationId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class BookingsFacade
    {
        private IRestClient restClient;

        public BookingsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get a Booking by id
        /// </summary>
        /// <param name="bookingId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Booking>> Get(string bookingId)
        {
             var urlTemplate = "EventsManagement/Bookings/{0}";
             urlTemplate = string.Format(urlTemplate, bookingId);
            return await restClient.AtUrl(urlTemplate).Get<Booking>();
        }

        /// <summary>
        /// Get a summary for a single Booking.
        /// </summary>
        /// <param name="bookingId"></param>
        /// <returns></returns>
        public async Task<RestResponse<BookingSummary>> GetSummary(string bookingId)
        {
             var urlTemplate = "EventsManagement/Bookings/Summary/{0}";
             urlTemplate = string.Format(urlTemplate, bookingId);
            return await restClient.AtUrl(urlTemplate).Get<BookingSummary>();
        }

        /// <summary>
        /// Create a new Booking
        /// </summary>
        /// <param name="booking"></param>
        /// <returns></returns>
        public async Task<RestResponse<Booking>> Create(Booking booking)
        {
            return await restClient.AtUrl("EventsManagement/Bookings/").Post<Booking, Booking>(booking);
        }

        /// <summary>
        /// Update an existing Booking
        /// </summary>
        /// <param name="bookingId"></param>
        /// <param name="booking"></param>
        /// <returns></returns>
        public async Task<RestResponse<Booking>> Update(string bookingId, Booking booking)
        {
             var urlTemplate = "EventsManagement/Bookings/{0}";
             urlTemplate = string.Format(urlTemplate, bookingId);
            return await restClient.AtUrl(urlTemplate).Put<Booking, Booking>(booking);
        }

        /// <summary>
        /// Delete a Booking by id
        /// </summary>
        /// <param name="bookingId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string bookingId)
        {
             var urlTemplate = "EventsManagement/Bookings/{0}";
             urlTemplate = string.Format(urlTemplate, bookingId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Get summary of all the documents associated with the booking. (Excluding the file contents)
        /// </summary>
        /// <param name="bookingId"></param>
        /// <returns></returns>
        public async Task<RestResponse<DocumentSummaries>> GetAllDocumentSummaries(string bookingId)
        {
             var urlTemplate = "EventsManagement/Bookings/{0}/Documents/Summary/";
             urlTemplate = string.Format(urlTemplate, bookingId);
            return await restClient.AtUrl(urlTemplate).Get<DocumentSummaries>();
        }

        /// <summary>
        /// Get all the documents associated with the booking (Including the file contents).
        /// </summary>
        /// <param name="bookingId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Documents>> GetAllDocuments(string bookingId)
        {
             var urlTemplate = "EventsManagement/Bookings/{0}/Documents/";
             urlTemplate = string.Format(urlTemplate, bookingId);
            return await restClient.AtUrl(urlTemplate).Get<Documents>();
        }

        /// <summary>
        /// Get the document associated with the documentId (Including the file contents).
        /// </summary>
        /// <param name="bookingId"></param>
        /// <param name="documentId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Document>> GetDocument(string bookingId, string documentId)
        {
             var urlTemplate = "EventsManagement/Bookings/{0}/Documents/{1}";
             urlTemplate = string.Format(urlTemplate, bookingId, documentId);
            return await restClient.AtUrl(urlTemplate).Get<Document>();
        }

        /// <summary>
        /// Add a document to the booking.
        /// </summary>
        /// <param name="bookingId"></param>
        /// <param name="document"></param>
        /// <returns></returns>
        public async Task<RestResponse<DocumentSummary>> AddDocument(string bookingId, Document document)
        {
             var urlTemplate = "EventsManagement/Bookings/{0}/Documents/";
             urlTemplate = string.Format(urlTemplate, bookingId);
            return await restClient.AtUrl(urlTemplate).Post<Document, DocumentSummary>(document);
        }

        /// <summary>
        /// Delete a document attached to the booking.
        /// </summary>
        /// <param name="bookingId"></param>
        /// <param name="documentId"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> DeleteDocument(string bookingId, string documentId)
        {
             var urlTemplate = "EventsManagement/Bookings/{0}/Documents/{1}";
             urlTemplate = string.Format(urlTemplate, bookingId, documentId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class BookingsFacadeBatch
    {
        private IRestClient restClient;

        public BookingsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get a Booking by id
        /// </summary>
        /// <param name="bookingId"></param>
        /// <returns></returns>
        public Request Get(string bookingId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Booking";
            bRequest.Content = null;

            var urlTemplate = "EventsManagement/Bookings/{0}";
            urlTemplate = string.Format(urlTemplate, bookingId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get a summary for a single Booking.
        /// </summary>
        /// <param name="bookingId"></param>
        /// <returns></returns>
        public Request GetSummary(string bookingId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BookingSummary";
            bRequest.Content = null;

            var urlTemplate = "EventsManagement/Bookings/Summary/{0}";
            urlTemplate = string.Format(urlTemplate, bookingId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new Booking
        /// </summary>
        /// <param name="booking"></param>
        /// <returns></returns>
        public Request Create(Booking booking, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Booking";
            bRequest.Content = booking;

            bRequest.Uri = restClient.GetBaseUrl() + "EventsManagement/Bookings/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing Booking
        /// </summary>
        /// <param name="bookingId"></param>
        /// <param name="booking"></param>
        /// <returns></returns>
        public Request Update(string bookingId, Booking booking, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Booking";
            bRequest.Content = booking;

            var urlTemplate = "EventsManagement/Bookings/{0}";
            urlTemplate = string.Format(urlTemplate, bookingId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete a Booking by id
        /// </summary>
        /// <param name="bookingId"></param>
        public Request Delete(string bookingId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "EventsManagement/Bookings/{0}";
            urlTemplate = string.Format(urlTemplate, bookingId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get summary of all the documents associated with the booking. (Excluding the file contents)
        /// </summary>
        /// <param name="bookingId"></param>
        /// <returns></returns>
        public Request GetAllDocumentSummaries(string bookingId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DocumentSummaries";
            bRequest.Content = null;

            var urlTemplate = "EventsManagement/Bookings/{0}/Documents/Summary/";
            urlTemplate = string.Format(urlTemplate, bookingId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get all the documents associated with the booking (Including the file contents).
        /// </summary>
        /// <param name="bookingId"></param>
        /// <returns></returns>
        public Request GetAllDocuments(string bookingId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Documents";
            bRequest.Content = null;

            var urlTemplate = "EventsManagement/Bookings/{0}/Documents/";
            urlTemplate = string.Format(urlTemplate, bookingId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get the document associated with the documentId (Including the file contents).
        /// </summary>
        /// <param name="bookingId"></param>
        /// <param name="documentId"></param>
        /// <returns></returns>
        public Request GetDocument(string bookingId, string documentId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Document";
            bRequest.Content = null;

            var urlTemplate = "EventsManagement/Bookings/{0}/Documents/{1}";
            urlTemplate = string.Format(urlTemplate, bookingId, documentId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Add a document to the booking.
        /// </summary>
        /// <param name="bookingId"></param>
        /// <param name="document"></param>
        /// <returns></returns>
        public Request AddDocument(string bookingId, Document document, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DocumentSummary";
            bRequest.Content = document;

            var urlTemplate = "EventsManagement/Bookings/{0}/Documents/";
            urlTemplate = string.Format(urlTemplate, bookingId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete a document attached to the booking.
        /// </summary>
        /// <param name="bookingId"></param>
        /// <param name="documentId"></param>
        /// <returns></returns>
        public Request DeleteDocument(string bookingId, string documentId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "EventsManagement/Bookings/{0}/Documents/{1}";
            urlTemplate = string.Format(urlTemplate, bookingId, documentId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class BookingTemplatesFacade
    {
        private IRestClient restClient;

        public BookingTemplatesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get summary of all Booking Templates, filtered optionally by category.
        /// </summary>
        /// <param name="categoryId"></param>
        /// <returns></returns>
        public async Task<RestResponse<BookingTemplateSummaries>> GetSummaries(string categoryId = "")
        {
            var urlTemplate = "EventsManagement/BookingTemplates/Summary?categoryId={0}";
            urlTemplate = string.Format(urlTemplate, categoryId);
            return await restClient.AtUrl(urlTemplate).Get<BookingTemplateSummaries>();
        }

        /// <summary>
        /// Get a Booking Template by ID
        /// </summary>
        /// <param name="bookingTemplateId"></param>
        /// <returns></returns>
        public async Task<RestResponse<BookingTemplate>> Get(string bookingTemplateId)
        {
             var urlTemplate = "EventsManagement/BookingTemplates/{0}";
             urlTemplate = string.Format(urlTemplate, bookingTemplateId);
            return await restClient.AtUrl(urlTemplate).Get<BookingTemplate>();
        }

        /// <summary>
        /// Create a new Booking Template
        /// </summary>
        /// <param name="bookingTemplate"></param>
        /// <returns></returns>
        public async Task<RestResponse<BookingTemplate>> Create(BookingTemplate bookingTemplate)
        {
            return await restClient.AtUrl("EventsManagement/BookingTemplates/").Post<BookingTemplate, BookingTemplate>(bookingTemplate);
        }

        /// <summary>
        /// Update an existing Booking Template
        /// </summary>
        /// <param name="bookingTemplateId"></param>
        /// <param name="bookingTemplate"></param>
        /// <returns></returns>
        public async Task<RestResponse<BookingTemplate>> Update(string bookingTemplateId, BookingTemplate bookingTemplate)
        {
             var urlTemplate = "EventsManagement/BookingTemplates/{0}";
             urlTemplate = string.Format(urlTemplate, bookingTemplateId);
            return await restClient.AtUrl(urlTemplate).Put<BookingTemplate, BookingTemplate>(bookingTemplate);
        }

        /// <summary>
        /// Delete a Booking Template by ID
        /// </summary>
        /// <param name="bookingTemplateId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string bookingTemplateId)
        {
             var urlTemplate = "EventsManagement/BookingTemplates/{0}";
             urlTemplate = string.Format(urlTemplate, bookingTemplateId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class BookingTemplatesFacadeBatch
    {
        private IRestClient restClient;

        public BookingTemplatesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get summary of all Booking Templates, filtered optionally by category.
        /// </summary>
        /// <param name="categoryId"></param>
        /// <returns></returns>
        public Request GetSummaries(string categoryId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BookingTemplateSummaries";
            bRequest.Content = null;

            var urlTemplate = "EventsManagement/BookingTemplates/Summary?categoryId={0}";
            urlTemplate = string.Format(urlTemplate, categoryId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get a Booking Template by ID
        /// </summary>
        /// <param name="bookingTemplateId"></param>
        /// <returns></returns>
        public Request Get(string bookingTemplateId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BookingTemplate";
            bRequest.Content = null;

            var urlTemplate = "EventsManagement/BookingTemplates/{0}";
            urlTemplate = string.Format(urlTemplate, bookingTemplateId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new Booking Template
        /// </summary>
        /// <param name="bookingTemplate"></param>
        /// <returns></returns>
        public Request Create(BookingTemplate bookingTemplate, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BookingTemplate";
            bRequest.Content = bookingTemplate;

            bRequest.Uri = restClient.GetBaseUrl() + "EventsManagement/BookingTemplates/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing Booking Template
        /// </summary>
        /// <param name="bookingTemplateId"></param>
        /// <param name="bookingTemplate"></param>
        /// <returns></returns>
        public Request Update(string bookingTemplateId, BookingTemplate bookingTemplate, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BookingTemplate";
            bRequest.Content = bookingTemplate;

            var urlTemplate = "EventsManagement/BookingTemplates/{0}";
            urlTemplate = string.Format(urlTemplate, bookingTemplateId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete a Booking Template by ID
        /// </summary>
        /// <param name="bookingTemplateId"></param>
        public Request Delete(string bookingTemplateId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "EventsManagement/BookingTemplates/{0}";
            urlTemplate = string.Format(urlTemplate, bookingTemplateId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ResourceSchedulesFacade
    {
        private IRestClient restClient;

        public ResourceSchedulesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get a list of resource schedules for one or more resources.
        /// </summary>
        /// <param name="resourceIds">A comma separated list of resource ids.</param>
        /// <param name="constituentIds">A comma separated list of constituent ids.</param>
        /// <param name="typeIds">A comma separated list of type ids (from TR_SCHEDULE_TYPE). If not provided all types would be returned.</param>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <returns></returns>
        public async Task<RestResponse<ResourceSchedules>> GetAll(string resourceIds = "null", string constituentIds = "null", string typeIds = "null", string startDate = "null", string endDate = "null")
        {
            var urlTemplate = "EventsManagement/ResourceSchedules/?resourceIds={0}&constituentIds={1}&typeIds={2}&startDate={3}&endDate={4}";
            urlTemplate = string.Format(urlTemplate, resourceIds,constituentIds,typeIds,startDate,endDate);
            return await restClient.AtUrl(urlTemplate).Get<ResourceSchedules>();
        }

        /// <summary>
        /// Get a single resource schedule.
        /// </summary>
        /// <param name="resourceScheduleId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ResourceSchedule>> Get(string resourceScheduleId)
        {
             var urlTemplate = "EventsManagement/ResourceSchedules/{0}";
             urlTemplate = string.Format(urlTemplate, resourceScheduleId);
            return await restClient.AtUrl(urlTemplate).Get<ResourceSchedule>();
        }

        /// <summary>
        /// Create a Busy or Available resource schedule.  Booking Assignment Schedules must be created in a booking.
        /// </summary>
        /// <param name="resourceSchedule"></param>
        /// <returns></returns>
        public async Task<RestResponse<ResourceSchedule>> Create(ResourceSchedule resourceSchedule)
        {
            return await restClient.AtUrl("EventsManagement/ResourceSchedules/").Post<ResourceSchedule, ResourceSchedule>(resourceSchedule);
        }

        /// <summary>
        /// Update a specific resource schedule.  Only Busy or Available types can be updated.
        /// </summary>
        /// <param name="resourceScheduleId"></param>
        /// <param name="resourceSchedule"></param>
        /// <returns></returns>
        public async Task<RestResponse<ResourceSchedule>> Update(string resourceScheduleId, ResourceSchedule resourceSchedule)
        {
             var urlTemplate = "EventsManagement/ResourceSchedules/{0}";
             urlTemplate = string.Format(urlTemplate, resourceScheduleId);
            return await restClient.AtUrl(urlTemplate).Put<ResourceSchedule, ResourceSchedule>(resourceSchedule);
        }

        /// <summary>
        /// Delete a busy or available resource schedule.  Booking Assignment Schedules must be deleted by updating their booking.
        /// </summary>
        /// <param name="resourceScheduleId"></param>
        /// <param name="overrideConflicts">When passed as true and the user group has rights to Override Resource Assignments, any overlapping will be updated to Ignore Schedule Conflicts</param>
        public async Task<RestResponse<NoResponse>> Delete(string resourceScheduleId, string overrideConflicts = "")
        {
             var urlTemplate = "EventsManagement/ResourceSchedules/{0}?overrideConflicts={1}";
             urlTemplate = string.Format(urlTemplate, resourceScheduleId, overrideConflicts);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ResourceSchedulesFacadeBatch
    {
        private IRestClient restClient;

        public ResourceSchedulesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get a list of resource schedules for one or more resources.
        /// </summary>
        /// <param name="resourceIds">A comma separated list of resource ids.</param>
        /// <param name="constituentIds">A comma separated list of constituent ids.</param>
        /// <param name="typeIds">A comma separated list of type ids (from TR_SCHEDULE_TYPE). If not provided all types would be returned.</param>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <returns></returns>
        public Request GetAll(string resourceIds = "null", string constituentIds = "null", string typeIds = "null", string startDate = "null", string endDate = "null", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ResourceSchedules";
            bRequest.Content = null;

            var urlTemplate = "EventsManagement/ResourceSchedules/?resourceIds={0}&constituentIds={1}&typeIds={2}&startDate={3}&endDate={4}";
            urlTemplate = string.Format(urlTemplate, resourceIds,constituentIds,typeIds,startDate,endDate);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get a single resource schedule.
        /// </summary>
        /// <param name="resourceScheduleId"></param>
        /// <returns></returns>
        public Request Get(string resourceScheduleId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ResourceSchedule";
            bRequest.Content = null;

            var urlTemplate = "EventsManagement/ResourceSchedules/{0}";
            urlTemplate = string.Format(urlTemplate, resourceScheduleId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a Busy or Available resource schedule.  Booking Assignment Schedules must be created in a booking.
        /// </summary>
        /// <param name="resourceSchedule"></param>
        /// <returns></returns>
        public Request Create(ResourceSchedule resourceSchedule, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ResourceSchedule";
            bRequest.Content = resourceSchedule;

            bRequest.Uri = restClient.GetBaseUrl() + "EventsManagement/ResourceSchedules/";

            return bRequest;
        }

        /// <summary>
        /// Update a specific resource schedule.  Only Busy or Available types can be updated.
        /// </summary>
        /// <param name="resourceScheduleId"></param>
        /// <param name="resourceSchedule"></param>
        /// <returns></returns>
        public Request Update(string resourceScheduleId, ResourceSchedule resourceSchedule, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ResourceSchedule";
            bRequest.Content = resourceSchedule;

            var urlTemplate = "EventsManagement/ResourceSchedules/{0}";
            urlTemplate = string.Format(urlTemplate, resourceScheduleId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete a busy or available resource schedule.  Booking Assignment Schedules must be deleted by updating their booking.
        /// </summary>
        /// <param name="resourceScheduleId"></param>
        /// <param name="overrideConflicts">When passed as true and the user group has rights to Override Resource Assignments, any overlapping will be updated to Ignore Schedule Conflicts</param>
        public Request Delete(string resourceScheduleId, string overrideConflicts = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "EventsManagement/ResourceSchedules/{0}?overrideConflicts={1}";
            urlTemplate = string.Format(urlTemplate, resourceScheduleId, overrideConflicts);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ResourcesFacade
    {
        private IRestClient restClient;

        public ResourcesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all resources optionally filtered by Resource Type, Category, or ConstituentId (for Worker type only). IncludeAffiliations parameter only accepted when ConstituentId provided.
        /// </summary>
        /// <param name="resourceTypeIds"></param>
        /// <param name="categoryIds"></param>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public async Task<RestResponse<Resources>> GetAll(string resourceTypeIds = "", string categoryIds = "", string constituentId = "", string includeAffiliations = "false")
        {
            var urlTemplate = "EventsManagement/Resources/?resourceTypeIds={0}&categoryIds={1}&constituentId={2}&includeAffiliations={3}";
            urlTemplate = string.Format(urlTemplate, resourceTypeIds,categoryIds,constituentId,includeAffiliations);
            return await restClient.AtUrl(urlTemplate).Get<Resources>();
        }

        /// <summary>
        /// Get all resources in summary optionally filtered by Resource Type, Category, or Constituent (for Worker Type only). IncludeAffiliations parameter only accepted when ConstituentId provided.
        /// </summary>
        /// <param name="resourceTypeIds"></param>
        /// <param name="categoryIds"></param>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public async Task<RestResponse<ResourceSummaries>> GetSummaries(string resourceTypeIds = "", string categoryIds = "", string constituentId = "", string includeAffiliations = "false")
        {
            var urlTemplate = "EventsManagement/Resources/Summary?resourceTypeIds={0}&categoryIds={1}&constituentId={2}&includeAffiliations={3}";
            urlTemplate = string.Format(urlTemplate, resourceTypeIds,categoryIds,constituentId,includeAffiliations);
            return await restClient.AtUrl(urlTemplate).Get<ResourceSummaries>();
        }

        /// <summary>
        /// Get a specific Resource.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Resource>> Get(string id)
        {
             var urlTemplate = "EventsManagement/Resources/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Get<Resource>();
        }

        /// <summary>
        /// Get the resource usage information.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ResourceUsage>> HasUsages(string id)
        {
             var urlTemplate = "EventsManagement/Resources/{0}/Usages";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Get<ResourceUsage>();
        }

        /// <summary>
        /// Get schedules and qualifications that apply to a set of resources and/or constituents during certain period of time.
        /// </summary>
        /// <param name="resourceIds">A comma separated list of resource ids.</param>
        /// <param name="constituentIds">A comma separated list of constituent ids.</param>
        /// <param name="startDateTime"></param>
        /// <param name="endDateTime"></param>
        /// <param name="expandWorkerAssignments"></param>
        public async Task<RestResponse<ResourceDetails>> GetDetails(string resourceIds = "", string constituentIds = "", string startDateTime = "", string endDateTime = "", string expandWorkerAssignments = "false")
        {
            var urlTemplate = "EventsManagement/Resources/Details?resourceIds={0}&constituentIds={1}&startDateTime={2}&endDateTime={3}&expandWorkerAssignments={4}";
            urlTemplate = string.Format(urlTemplate, resourceIds,constituentIds,startDateTime,endDateTime,expandWorkerAssignments);
            return await restClient.AtUrl(urlTemplate).Get<ResourceDetails>();
        }

        /// <summary>
        /// Get schedule occurrences for set of resources and/or constituents during certain period of time.
        /// </summary>
        public async Task<RestResponse<ScheduleOccurrences>> GetScheduleOccurrences(ScheduleOccurrencesRequest request)
        {
            return await restClient.AtUrl("EventsManagement/Resources/ScheduleOccurrences").Post<ScheduleOccurrencesRequest, ScheduleOccurrences>(request);
        }

        /// <summary>
        /// Create a Resource.
        /// </summary>
        /// <param name="resource"></param>
        /// <returns></returns>
        public async Task<RestResponse<Resource>> Create(Resource resource)
        {
            return await restClient.AtUrl("EventsManagement/Resources/").Post<Resource, Resource>(resource);
        }

        /// <summary>
        /// Update an existing Resource.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="resource"></param>
        /// <returns></returns>
        public async Task<RestResponse<Resource>> Update(string id, Resource resource)
        {
             var urlTemplate = "EventsManagement/Resources/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<Resource, Resource>(resource);
        }

        /// <summary>
        /// Delete an existing Resource.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="removeUsages"></param>
        public async Task<RestResponse<NoResponse>> Delete(string id, string removeUsages = "")
        {
             var urlTemplate = "EventsManagement/Resources/{0}?removeUsages={1}";
             urlTemplate = string.Format(urlTemplate, id, removeUsages);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ResourcesFacadeBatch
    {
        private IRestClient restClient;

        public ResourcesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all resources optionally filtered by Resource Type, Category, or ConstituentId (for Worker type only). IncludeAffiliations parameter only accepted when ConstituentId provided.
        /// </summary>
        /// <param name="resourceTypeIds"></param>
        /// <param name="categoryIds"></param>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public Request GetAll(string resourceTypeIds = "", string categoryIds = "", string constituentId = "", string includeAffiliations = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Resources";
            bRequest.Content = null;

            var urlTemplate = "EventsManagement/Resources/?resourceTypeIds={0}&categoryIds={1}&constituentId={2}&includeAffiliations={3}";
            urlTemplate = string.Format(urlTemplate, resourceTypeIds,categoryIds,constituentId,includeAffiliations);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get all resources in summary optionally filtered by Resource Type, Category, or Constituent (for Worker Type only). IncludeAffiliations parameter only accepted when ConstituentId provided.
        /// </summary>
        /// <param name="resourceTypeIds"></param>
        /// <param name="categoryIds"></param>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public Request GetSummaries(string resourceTypeIds = "", string categoryIds = "", string constituentId = "", string includeAffiliations = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ResourceSummaries";
            bRequest.Content = null;

            var urlTemplate = "EventsManagement/Resources/Summary?resourceTypeIds={0}&categoryIds={1}&constituentId={2}&includeAffiliations={3}";
            urlTemplate = string.Format(urlTemplate, resourceTypeIds,categoryIds,constituentId,includeAffiliations);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get a specific Resource.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Resource";
            bRequest.Content = null;

            var urlTemplate = "EventsManagement/Resources/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get the resource usage information.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request HasUsages(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ResourceUsage";
            bRequest.Content = null;

            var urlTemplate = "EventsManagement/Resources/{0}/Usages";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get schedules and qualifications that apply to a set of resources and/or constituents during certain period of time.
        /// </summary>
        /// <param name="resourceIds">A comma separated list of resource ids.</param>
        /// <param name="constituentIds">A comma separated list of constituent ids.</param>
        /// <param name="startDateTime"></param>
        /// <param name="endDateTime"></param>
        /// <param name="expandWorkerAssignments"></param>
        public Request GetDetails(string resourceIds = "", string constituentIds = "", string startDateTime = "", string endDateTime = "", string expandWorkerAssignments = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ResourceDetails";
            bRequest.Content = null;

            var urlTemplate = "EventsManagement/Resources/Details?resourceIds={0}&constituentIds={1}&startDateTime={2}&endDateTime={3}&expandWorkerAssignments={4}";
            urlTemplate = string.Format(urlTemplate, resourceIds,constituentIds,startDateTime,endDateTime,expandWorkerAssignments);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get schedule occurrences for set of resources and/or constituents during certain period of time.
        /// </summary>
        public Request GetScheduleOccurrences(ScheduleOccurrencesRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ScheduleOccurrences";
            bRequest.Content = request;

            bRequest.Uri = restClient.GetBaseUrl() + "EventsManagement/Resources/ScheduleOccurrences";

            return bRequest;
        }

        /// <summary>
        /// Create a Resource.
        /// </summary>
        /// <param name="resource"></param>
        /// <returns></returns>
        public Request Create(Resource resource, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Resource";
            bRequest.Content = resource;

            bRequest.Uri = restClient.GetBaseUrl() + "EventsManagement/Resources/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing Resource.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="resource"></param>
        /// <returns></returns>
        public Request Update(string id, Resource resource, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Resource";
            bRequest.Content = resource;

            var urlTemplate = "EventsManagement/Resources/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing Resource.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="removeUsages"></param>
        public Request Delete(string id, string removeUsages = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "EventsManagement/Resources/{0}?removeUsages={1}";
            urlTemplate = string.Format(urlTemplate, id, removeUsages);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ResourceTypesFacade
    {
        private IRestClient restClient;

        public ResourceTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all resource types.
        /// </summary>
        /// <param name="categoryIds"></param>
        /// <returns></returns>
        public async Task<RestResponse<ResourceTypes>> GetAll(string categoryIds = "")
        {
            var urlTemplate = "EventsManagement/ResourceTypes/?categoryIds={0}";
            urlTemplate = string.Format(urlTemplate, categoryIds);
            return await restClient.AtUrl(urlTemplate).Get<ResourceTypes>();
        }

        /// <summary>
        /// Get summary of all resource types.
        /// </summary>
        /// <param name="categoryIds"></param>
        /// <returns></returns>
        public async Task<RestResponse<ResourceTypeSummaries>> GetSummaries(string categoryIds = "")
        {
            var urlTemplate = "EventsManagement/ResourceTypes/Summary/?categoryIds={0}";
            urlTemplate = string.Format(urlTemplate, categoryIds);
            return await restClient.AtUrl(urlTemplate).Get<ResourceTypeSummaries>();
        }

        /// <summary>
        /// Get all resource types.
        /// </summary>
        /// <returns></returns>
        public async Task<RestResponse<ResourceType>> Get(string id = "")
        {
             var urlTemplate = "EventsManagement/ResourceTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Get<ResourceType>();
        }

        /// <summary>
        /// Create a new resource type.
        /// </summary>
        /// <param name="resourceType"></param>
        /// <returns></returns>
        public async Task<RestResponse<ResourceType>> Create(ResourceType resourceType)
        {
            return await restClient.AtUrl("EventsManagement/ResourceTypes/").Post<ResourceType, ResourceType>(resourceType);
        }

        /// <summary>
        /// Update an existing resource type.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="resourceType"></param>
        /// <returns></returns>
        public async Task<RestResponse<ResourceType>> Update(string id, ResourceType resourceType)
        {
             var urlTemplate = "EventsManagement/ResourceTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<ResourceType, ResourceType>(resourceType);
        }

        /// <summary>
        /// Delete an existing resource type.
        /// </summary>
        /// <param name="id"></param>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "EventsManagement/ResourceTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ResourceTypesFacadeBatch
    {
        private IRestClient restClient;

        public ResourceTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all resource types.
        /// </summary>
        /// <param name="categoryIds"></param>
        /// <returns></returns>
        public Request GetAll(string categoryIds = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ResourceTypes";
            bRequest.Content = null;

            var urlTemplate = "EventsManagement/ResourceTypes/?categoryIds={0}";
            urlTemplate = string.Format(urlTemplate, categoryIds);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get summary of all resource types.
        /// </summary>
        /// <param name="categoryIds"></param>
        /// <returns></returns>
        public Request GetSummaries(string categoryIds = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ResourceTypeSummaries";
            bRequest.Content = null;

            var urlTemplate = "EventsManagement/ResourceTypes/Summary/?categoryIds={0}";
            urlTemplate = string.Format(urlTemplate, categoryIds);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get all resource types.
        /// </summary>
        /// <returns></returns>
        public Request Get(string id = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ResourceType";
            bRequest.Content = null;

            var urlTemplate = "EventsManagement/ResourceTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new resource type.
        /// </summary>
        /// <param name="resourceType"></param>
        /// <returns></returns>
        public Request Create(ResourceType resourceType, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ResourceType";
            bRequest.Content = resourceType;

            bRequest.Uri = restClient.GetBaseUrl() + "EventsManagement/ResourceTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing resource type.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="resourceType"></param>
        /// <returns></returns>
        public Request Update(string id, ResourceType resourceType, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ResourceType";
            bRequest.Content = resourceType;

            var urlTemplate = "EventsManagement/ResourceTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing resource type.
        /// </summary>
        /// <param name="id"></param>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "EventsManagement/ResourceTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class AppealsFacade
    {
        private IRestClient restClient;

        public AppealsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<AppealSummaries>> GetAllSummaries()
        {
            return await restClient.AtUrl("Finance/Appeals/Summary").Get<AppealSummaries>();
        }

        /// <summary>
        /// Get details of an Appeal.
        /// </summary>
        /// <param name="appealId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Appeal>> Get(string appealId = "")
        {
             var urlTemplate = "Finance/Appeals/{0}";
             urlTemplate = string.Format(urlTemplate, appealId);
            return await restClient.AtUrl(urlTemplate).Get<Appeal>();
        }

    }
 

 
    /// 
    public class AppealsFacadeBatch
    {
        private IRestClient restClient;

        public AppealsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAllSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AppealSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "Finance/Appeals/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get details of an Appeal.
        /// </summary>
        /// <param name="appealId"></param>
        /// <returns></returns>
        public Request Get(string appealId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Appeal";
            bRequest.Content = null;

            var urlTemplate = "Finance/Appeals/{0}";
            urlTemplate = string.Format(urlTemplate, appealId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class BatchMaintenanceFacade
    {
        private IRestClient restClient;

        public BatchMaintenanceFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get a single Batch
        /// </summary>
        /// <param name="batchId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Batch>> Get(string batchId = "")
        {
             var urlTemplate = "Finance/BatchMaintenance/{0}";
             urlTemplate = string.Format(urlTemplate, batchId);
            return await restClient.AtUrl(urlTemplate).Get<Batch>();
        }

        /// <summary>
        /// Returns all open or held batches owned by the service user. Optionally filters out controlled batches
        /// </summary>
        /// <param name="includeControlled"></param>
        /// <returns></returns>
        public async Task<RestResponse<Batches>> Active(string includeControlled = "")
        {
            var urlTemplate = "Finance/BatchMaintenance/Active/?includeControlled={0}";
            urlTemplate = string.Format(urlTemplate, includeControlled);
            return await restClient.AtUrl(urlTemplate).Get<Batches>();
        }

        /// <summary>
        /// Create a new Batch
        /// </summary>
        /// <param name="batch"></param>
        /// <returns></returns>
        public async Task<RestResponse<Batch>> Create(Batch batch)
        {
            return await restClient.AtUrl("Finance/BatchMaintenance/").Post<Batch, Batch>(batch);
        }

    }
 

 
    /// 
    public class BatchMaintenanceFacadeBatch
    {
        private IRestClient restClient;

        public BatchMaintenanceFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get a single Batch
        /// </summary>
        /// <param name="batchId"></param>
        /// <returns></returns>
        public Request Get(string batchId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Batch";
            bRequest.Content = null;

            var urlTemplate = "Finance/BatchMaintenance/{0}";
            urlTemplate = string.Format(urlTemplate, batchId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Returns all open or held batches owned by the service user. Optionally filters out controlled batches
        /// </summary>
        /// <param name="includeControlled"></param>
        /// <returns></returns>
        public Request Active(string includeControlled = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Batches";
            bRequest.Content = null;

            var urlTemplate = "Finance/BatchMaintenance/Active/?includeControlled={0}";
            urlTemplate = string.Format(urlTemplate, includeControlled);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new Batch
        /// </summary>
        /// <param name="batch"></param>
        /// <returns></returns>
        public Request Create(Batch batch, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Batch";
            bRequest.Content = batch;

            bRequest.Uri = restClient.GetBaseUrl() + "Finance/BatchMaintenance/";

            return bRequest;
        }

    }
 

 
    /// 
    public class BatchTypeUserGroupFacade
    {
        private IRestClient restClient;

        public BatchTypeUserGroupFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<BatchTypeUserGroups>> GetAll()
        {
            return await restClient.AtUrl("Finance/BatchTypeUserGroups/").Get<BatchTypeUserGroups>();
        }

    }
 

 
    /// 
    public class BatchTypeUserGroupFacadeBatch
    {
        private IRestClient restClient;

        public BatchTypeUserGroupFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BatchTypeUserGroups";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "Finance/BatchTypeUserGroups/";

            return bRequest;
        }

    }
 

 
    /// 
    public class CampaignDesignationsFacade
    {
        private IRestClient restClient;

        public CampaignDesignationsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all Designations associated to a Campaign.
        /// </summary>
        /// <param name="campaignId"></param>
        /// <returns></returns>
        public async Task<RestResponse<CampaignDesignations>> GetAll(string campaignId = "")
        {
            var urlTemplate = "Finance/CampaignDesignations/?campaignId={0}";
            urlTemplate = string.Format(urlTemplate, campaignId);
            return await restClient.AtUrl(urlTemplate).Get<CampaignDesignations>();
        }

        /// <summary>
        /// Get a single Designation associated to a Campaign.
        /// </summary>
        /// <param name="campaignDesignationId"></param>
        /// <returns></returns>
        public async Task<RestResponse<CampaignDesignation>> Get(string campaignDesignationId = "")
        {
             var urlTemplate = "Finance/CampaignDesignations/{0}";
             urlTemplate = string.Format(urlTemplate, campaignDesignationId);
            return await restClient.AtUrl(urlTemplate).Get<CampaignDesignation>();
        }

        /// <summary>
        /// Create a new association between a Designation and a Campaign.
        /// </summary>
        /// <param name="campaignDesignation"></param>
        /// <returns></returns>
        public async Task<RestResponse<CampaignDesignation>> Create(CampaignDesignation campaignDesignation)
        {
            return await restClient.AtUrl("Finance/CampaignDesignations/").Post<CampaignDesignation, CampaignDesignation>(campaignDesignation);
        }

        /// <summary>
        /// Update an association between a Designation and a Campaign.
        /// </summary>
        /// <param name="campaignDesignationId"></param>
        /// <param name="campaignDesignation"></param>
        /// <returns></returns>
        public async Task<RestResponse<CampaignDesignation>> Update(string campaignDesignationId, CampaignDesignation campaignDesignation)
        {
             var urlTemplate = "Finance/CampaignDesignations/{0}";
             urlTemplate = string.Format(urlTemplate, campaignDesignationId);
            return await restClient.AtUrl(urlTemplate).Put<CampaignDesignation, CampaignDesignation>(campaignDesignation);
        }

        /// <summary>
        /// Delete an asssociation between a Designation and a Campaign.
        /// </summary>
        /// <param name="campaignDesignationId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string campaignDesignationId)
        {
             var urlTemplate = "Finance/CampaignDesignations/{0}";
             urlTemplate = string.Format(urlTemplate, campaignDesignationId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class CampaignDesignationsFacadeBatch
    {
        private IRestClient restClient;

        public CampaignDesignationsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all Designations associated to a Campaign.
        /// </summary>
        /// <param name="campaignId"></param>
        /// <returns></returns>
        public Request GetAll(string campaignId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CampaignDesignations";
            bRequest.Content = null;

            var urlTemplate = "Finance/CampaignDesignations/?campaignId={0}";
            urlTemplate = string.Format(urlTemplate, campaignId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get a single Designation associated to a Campaign.
        /// </summary>
        /// <param name="campaignDesignationId"></param>
        /// <returns></returns>
        public Request Get(string campaignDesignationId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CampaignDesignation";
            bRequest.Content = null;

            var urlTemplate = "Finance/CampaignDesignations/{0}";
            urlTemplate = string.Format(urlTemplate, campaignDesignationId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new association between a Designation and a Campaign.
        /// </summary>
        /// <param name="campaignDesignation"></param>
        /// <returns></returns>
        public Request Create(CampaignDesignation campaignDesignation, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CampaignDesignation";
            bRequest.Content = campaignDesignation;

            bRequest.Uri = restClient.GetBaseUrl() + "Finance/CampaignDesignations/";

            return bRequest;
        }

        /// <summary>
        /// Update an association between a Designation and a Campaign.
        /// </summary>
        /// <param name="campaignDesignationId"></param>
        /// <param name="campaignDesignation"></param>
        /// <returns></returns>
        public Request Update(string campaignDesignationId, CampaignDesignation campaignDesignation, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CampaignDesignation";
            bRequest.Content = campaignDesignation;

            var urlTemplate = "Finance/CampaignDesignations/{0}";
            urlTemplate = string.Format(urlTemplate, campaignDesignationId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an asssociation between a Designation and a Campaign.
        /// </summary>
        /// <param name="campaignDesignationId"></param>
        public Request Delete(string campaignDesignationId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Finance/CampaignDesignations/{0}";
            urlTemplate = string.Format(urlTemplate, campaignDesignationId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class CampaignFundsFacade
    {
        private IRestClient restClient;

        public CampaignFundsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all Funds associated to a Campaign.
        /// </summary>
        /// <param name="campaignId"></param>
        /// <param name="asOfDateTime"></param>
        /// <returns></returns>
        public async Task<RestResponse<CampaignFunds>> GetAll(string campaignId = "", string asOfDateTime = "")
        {
            var urlTemplate = "Finance/CampaignFunds/?campaignId={0}&asOfDateTime={1}";
            urlTemplate = string.Format(urlTemplate, campaignId,asOfDateTime);
            return await restClient.AtUrl(urlTemplate).Get<CampaignFunds>();
        }

        /// <summary>
        /// Get a single Fund associated to a Campaign.
        /// </summary>
        /// <param name="campaignFundId"></param>
        /// <returns></returns>
        public async Task<RestResponse<CampaignFund>> Get(string campaignFundId = "")
        {
             var urlTemplate = "Finance/CampaignFunds/{0}";
             urlTemplate = string.Format(urlTemplate, campaignFundId);
            return await restClient.AtUrl(urlTemplate).Get<CampaignFund>();
        }

        /// <summary>
        /// Create a new Fund association to a Campaign.
        /// </summary>
        /// <param name="campaignFund"></param>
        /// <returns></returns>
        public async Task<RestResponse<CampaignFund>> Create(CampaignFund campaignFund)
        {
            return await restClient.AtUrl("Finance/CampaignFunds/").Post<CampaignFund, CampaignFund>(campaignFund);
        }

        /// <summary>
        /// Update a Fund association to a Campaign.
        /// </summary>
        /// <param name="campaignFundId"></param>
        /// <param name="campaignFund"></param>
        /// <returns></returns>
        public async Task<RestResponse<CampaignFund>> Update(string campaignFundId, CampaignFund campaignFund)
        {
             var urlTemplate = "Finance/CampaignFunds/{0}";
             urlTemplate = string.Format(urlTemplate, campaignFundId);
            return await restClient.AtUrl(urlTemplate).Put<CampaignFund, CampaignFund>(campaignFund);
        }

        /// <summary>
        /// Delete a fund association from a Campaign.
        /// </summary>
        /// <param name="campaignFundId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string campaignFundId)
        {
             var urlTemplate = "Finance/CampaignFunds/{0}";
             urlTemplate = string.Format(urlTemplate, campaignFundId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class CampaignFundsFacadeBatch
    {
        private IRestClient restClient;

        public CampaignFundsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all Funds associated to a Campaign.
        /// </summary>
        /// <param name="campaignId"></param>
        /// <param name="asOfDateTime"></param>
        /// <returns></returns>
        public Request GetAll(string campaignId = "", string asOfDateTime = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CampaignFunds";
            bRequest.Content = null;

            var urlTemplate = "Finance/CampaignFunds/?campaignId={0}&asOfDateTime={1}";
            urlTemplate = string.Format(urlTemplate, campaignId,asOfDateTime);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get a single Fund associated to a Campaign.
        /// </summary>
        /// <param name="campaignFundId"></param>
        /// <returns></returns>
        public Request Get(string campaignFundId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CampaignFund";
            bRequest.Content = null;

            var urlTemplate = "Finance/CampaignFunds/{0}";
            urlTemplate = string.Format(urlTemplate, campaignFundId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new Fund association to a Campaign.
        /// </summary>
        /// <param name="campaignFund"></param>
        /// <returns></returns>
        public Request Create(CampaignFund campaignFund, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CampaignFund";
            bRequest.Content = campaignFund;

            bRequest.Uri = restClient.GetBaseUrl() + "Finance/CampaignFunds/";

            return bRequest;
        }

        /// <summary>
        /// Update a Fund association to a Campaign.
        /// </summary>
        /// <param name="campaignFundId"></param>
        /// <param name="campaignFund"></param>
        /// <returns></returns>
        public Request Update(string campaignFundId, CampaignFund campaignFund, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CampaignFund";
            bRequest.Content = campaignFund;

            var urlTemplate = "Finance/CampaignFunds/{0}";
            urlTemplate = string.Format(urlTemplate, campaignFundId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete a fund association from a Campaign.
        /// </summary>
        /// <param name="campaignFundId"></param>
        public Request Delete(string campaignFundId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Finance/CampaignFunds/{0}";
            urlTemplate = string.Format(urlTemplate, campaignFundId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class CampaignsFacade
    {
        private IRestClient restClient;

        public CampaignsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<CampaignSummaries>> GetAllSummaries()
        {
            return await restClient.AtUrl("Finance/Campaigns/Summary").Get<CampaignSummaries>();
        }

        /// <summary>
        /// Get summary of a specific campaign.
        /// </summary>
        /// <param name="campaignId"></param>
        /// <returns></returns>
        public async Task<RestResponse<CampaignSummary>> Get(string campaignId = "")
        {
             var urlTemplate = "Finance/Campaigns/{0}/Summary";
             urlTemplate = string.Format(urlTemplate, campaignId);
            return await restClient.AtUrl(urlTemplate).Get<CampaignSummary>();
        }

    }
 

 
    /// 
    public class CampaignsFacadeBatch
    {
        private IRestClient restClient;

        public CampaignsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAllSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CampaignSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "Finance/Campaigns/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get summary of a specific campaign.
        /// </summary>
        /// <param name="campaignId"></param>
        /// <returns></returns>
        public Request Get(string campaignId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CampaignSummary";
            bRequest.Content = null;

            var urlTemplate = "Finance/Campaigns/{0}/Summary";
            urlTemplate = string.Format(urlTemplate, campaignId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ContributionsFacade
    {
        private IRestClient restClient;

        public ContributionsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the contributions for the specified plan.
        /// </summary>
        /// <param name="planId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Contributions>> GetAll(string planId = "")
        {
            var urlTemplate = "Finance/Contributions/?planId={0}";
            urlTemplate = string.Format(urlTemplate, planId);
            return await restClient.AtUrl(urlTemplate).Get<Contributions>();
        }

        /// <summary>
        /// Get details of a contribution.
        /// </summary>
        /// <param name="contributionId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Contribution>> Get(string contributionId = "")
        {
             var urlTemplate = "Finance/Contributions/{0}";
             urlTemplate = string.Format(urlTemplate, contributionId);
            return await restClient.AtUrl(urlTemplate).Get<Contribution>();
        }

    }
 

 
    /// 
    public class ContributionsFacadeBatch
    {
        private IRestClient restClient;

        public ContributionsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the contributions for the specified plan.
        /// </summary>
        /// <param name="planId"></param>
        /// <returns></returns>
        public Request GetAll(string planId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Contributions";
            bRequest.Content = null;

            var urlTemplate = "Finance/Contributions/?planId={0}";
            urlTemplate = string.Format(urlTemplate, planId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a contribution.
        /// </summary>
        /// <param name="contributionId"></param>
        /// <returns></returns>
        public Request Get(string contributionId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Contribution";
            bRequest.Content = null;

            var urlTemplate = "Finance/Contributions/{0}";
            urlTemplate = string.Format(urlTemplate, contributionId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class DocumentsFacade
    {
        private IRestClient restClient;

        public DocumentsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all the documents for a particular resource including file contents.  Only documents associated with steps may be returned at this time.
        /// </summary>
        /// <param name="stepId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Documents>> GetAll(string stepId = "")
        {
            var urlTemplate = "Finance/Documents/?stepId={0}";
            urlTemplate = string.Format(urlTemplate, stepId);
            return await restClient.AtUrl(urlTemplate).Get<Documents>();
        }

        /// <summary>
        /// Get summary of all the documents for the step.  Only a summary of file information is returned.
        /// </summary>
        /// <param name="stepId"></param>
        /// <returns></returns>
        public async Task<RestResponse<DocumentSummaries>> GetAllSummary(string stepId = "")
        {
            var urlTemplate = "Finance/Documents/Summary/?stepId={0}";
            urlTemplate = string.Format(urlTemplate, stepId);
            return await restClient.AtUrl(urlTemplate).Get<DocumentSummaries>();
        }

        /// <summary>
        /// Get the details of a document.
        /// </summary>
        /// <param name="documentId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Document>> Get(string documentId = "")
        {
             var urlTemplate = "Finance/Documents/{0}";
             urlTemplate = string.Format(urlTemplate, documentId);
            return await restClient.AtUrl(urlTemplate).Get<Document>();
        }

        /// 
        public async Task<RestResponse<DocumentSettings>> Settings()
        {
            return await restClient.AtUrl("Finance/Documents/Settings").Get<DocumentSettings>();
        }

        /// <summary>
        /// Delete a document.
        /// </summary>
        /// <param name="documentId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string documentId)
        {
             var urlTemplate = "Finance/Documents/{0}";
             urlTemplate = string.Format(urlTemplate, documentId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class DocumentsFacadeBatch
    {
        private IRestClient restClient;

        public DocumentsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all the documents for a particular resource including file contents.  Only documents associated with steps may be returned at this time.
        /// </summary>
        /// <param name="stepId"></param>
        /// <returns></returns>
        public Request GetAll(string stepId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Documents";
            bRequest.Content = null;

            var urlTemplate = "Finance/Documents/?stepId={0}";
            urlTemplate = string.Format(urlTemplate, stepId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get summary of all the documents for the step.  Only a summary of file information is returned.
        /// </summary>
        /// <param name="stepId"></param>
        /// <returns></returns>
        public Request GetAllSummary(string stepId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DocumentSummaries";
            bRequest.Content = null;

            var urlTemplate = "Finance/Documents/Summary/?stepId={0}";
            urlTemplate = string.Format(urlTemplate, stepId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get the details of a document.
        /// </summary>
        /// <param name="documentId"></param>
        /// <returns></returns>
        public Request Get(string documentId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Document";
            bRequest.Content = null;

            var urlTemplate = "Finance/Documents/{0}";
            urlTemplate = string.Format(urlTemplate, documentId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Settings(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DocumentSettings";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "Finance/Documents/Settings";

            return bRequest;
        }

        /// <summary>
        /// Delete a document.
        /// </summary>
        /// <param name="documentId"></param>
        public Request Delete(string documentId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Finance/Documents/{0}";
            urlTemplate = string.Format(urlTemplate, documentId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class FundsFacade
    {
        private IRestClient restClient;

        public FundsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get summary of all funds.
        /// </summary>
        /// <param name="ticketingIndicator"></param>
        /// <returns></returns>
        public async Task<RestResponse<FundSummaries>> GetAllSummaries(string ticketingIndicator = "")
        {
            var urlTemplate = "Finance/Funds/Summary?ticketingIndicator={0}";
            urlTemplate = string.Format(urlTemplate, ticketingIndicator);
            return await restClient.AtUrl(urlTemplate).Get<FundSummaries>();
        }

        /// <summary>
        /// Get details of a specific fund
        /// </summary>
        /// <param name="fundId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Fund>> Get(string fundId = "")
        {
             var urlTemplate = "Finance/Funds/{0}";
             urlTemplate = string.Format(urlTemplate, fundId);
            return await restClient.AtUrl(urlTemplate).Get<Fund>();
        }

    }
 

 
    /// 
    public class FundsFacadeBatch
    {
        private IRestClient restClient;

        public FundsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get summary of all funds.
        /// </summary>
        /// <param name="ticketingIndicator"></param>
        /// <returns></returns>
        public Request GetAllSummaries(string ticketingIndicator = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.FundSummaries";
            bRequest.Content = null;

            var urlTemplate = "Finance/Funds/Summary?ticketingIndicator={0}";
            urlTemplate = string.Format(urlTemplate, ticketingIndicator);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a specific fund
        /// </summary>
        /// <param name="fundId"></param>
        /// <returns></returns>
        public Request Get(string fundId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Fund";
            bRequest.Content = null;

            var urlTemplate = "Finance/Funds/{0}";
            urlTemplate = string.Format(urlTemplate, fundId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class GiftCertificatesFacade
    {
        private IRestClient restClient;

        public GiftCertificatesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of a specific gift certificate.
        /// The original amount, amount used and balance are all returned.  Amounts applied to a current web session are included.
        /// </summary>
        /// <param name="giftCertificateNumber"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftCertificateInfo>> Get(string giftCertificateNumber = "")
        {
             var urlTemplate = "Finance/GiftCertificates/{0}";
             urlTemplate = string.Format(urlTemplate, giftCertificateNumber);
            return await restClient.AtUrl(urlTemplate).Get<GiftCertificateInfo>();
        }

        /// <summary>
        /// Removes lock for gift certificate from any batch.
        /// </summary>
        /// <param name="giftCertificateNumber"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftCertificateInfo>> Unlock(string giftCertificateNumber = "")
        {
             var urlTemplate = "Finance/GiftCertificates/{0}/Unlock";
             urlTemplate = string.Format(urlTemplate, giftCertificateNumber);
            return await restClient.AtUrl(urlTemplate).Post<string, GiftCertificateInfo>(giftCertificateNumber);
        }

        /// <summary>
        /// Get transaction details for a gift certificate and lock it for redemption in a specific batch.
        /// </summary>
        /// <param name="giftCertificateRedemptionRequest"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftCertificateTransactions>> TransactionDetailsForRedemption(GiftCertificateRedemptionRequest giftCertificateRedemptionRequest)
        {
            return await restClient.AtUrl("Finance/GiftCertificates/TransactionDetailsForRedemption").Post<GiftCertificateRedemptionRequest, GiftCertificateTransactions>(giftCertificateRedemptionRequest);
        }

    }
 

 
    /// 
    public class GiftCertificatesFacadeBatch
    {
        private IRestClient restClient;

        public GiftCertificatesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of a specific gift certificate.
        /// The original amount, amount used and balance are all returned.  Amounts applied to a current web session are included.
        /// </summary>
        /// <param name="giftCertificateNumber"></param>
        /// <returns></returns>
        public Request Get(string giftCertificateNumber = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftCertificateInfo";
            bRequest.Content = null;

            var urlTemplate = "Finance/GiftCertificates/{0}";
            urlTemplate = string.Format(urlTemplate, giftCertificateNumber);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Removes lock for gift certificate from any batch.
        /// </summary>
        /// <param name="giftCertificateNumber"></param>
        /// <returns></returns>
        public Request Unlock(string giftCertificateNumber = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftCertificateInfo";
            bRequest.Content = giftCertificateNumber;

            var urlTemplate = "Finance/GiftCertificates/{0}/Unlock";
            urlTemplate = string.Format(urlTemplate, giftCertificateNumber);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get transaction details for a gift certificate and lock it for redemption in a specific batch.
        /// </summary>
        /// <param name="giftCertificateRedemptionRequest"></param>
        /// <returns></returns>
        public Request TransactionDetailsForRedemption(GiftCertificateRedemptionRequest giftCertificateRedemptionRequest, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftCertificateTransactions";
            bRequest.Content = giftCertificateRedemptionRequest;

            bRequest.Uri = restClient.GetBaseUrl() + "Finance/GiftCertificates/TransactionDetailsForRedemption";

            return bRequest;
        }

    }
 

 
    /// 
    public class ListContentsFacade
    {
        private IRestClient restClient;

        public ListContentsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Gets the contents of the listId that is passed in. If the value for the generate is passed in as true then the list is executed. The default value is false. If the value for the returnData is passed in as false then the list contents will not be returned.The default value is true.
        /// </summary>
        /// <param name="listId"></param>
        /// <param name="generate"></param>
        /// <param name="returnData"></param>
        /// <returns></returns>
        public async Task<RestResponse<ListContents>> Get(string listId = "", string generate = "", string returnData = "")
        {
            var urlTemplate = "Finance/ListContents/?listId={0}&generate={1}&returnData={2}";
            urlTemplate = string.Format(urlTemplate, listId,generate,returnData);
            return await restClient.AtUrl(urlTemplate).Get<ListContents>();
        }

        /// <summary>
        /// Gets constituent details for the contents of a list when listId is passed.
        /// </summary>
        /// <param name="listId"></param>
        /// <param name="generate"></param>
        /// <returns></returns>
        public async Task<RestResponse<ListContentsDetails>> GetDetail(string listId = "", string generate = "")
        {
            var urlTemplate = "Finance/ListContents/Details/?listId={0}&generate={1}";
            urlTemplate = string.Format(urlTemplate, listId,generate);
            return await restClient.AtUrl(urlTemplate).Get<ListContentsDetails>();
        }

    }
 

 
    /// 
    public class ListContentsFacadeBatch
    {
        private IRestClient restClient;

        public ListContentsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Gets the contents of the listId that is passed in. If the value for the generate is passed in as true then the list is executed. The default value is false. If the value for the returnData is passed in as false then the list contents will not be returned.The default value is true.
        /// </summary>
        /// <param name="listId"></param>
        /// <param name="generate"></param>
        /// <param name="returnData"></param>
        /// <returns></returns>
        public Request Get(string listId = "", string generate = "", string returnData = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ListContents";
            bRequest.Content = null;

            var urlTemplate = "Finance/ListContents/?listId={0}&generate={1}&returnData={2}";
            urlTemplate = string.Format(urlTemplate, listId,generate,returnData);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Gets constituent details for the contents of a list when listId is passed.
        /// </summary>
        /// <param name="listId"></param>
        /// <param name="generate"></param>
        /// <returns></returns>
        public Request GetDetail(string listId = "", string generate = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ListContentsDetails";
            bRequest.Content = null;

            var urlTemplate = "Finance/ListContents/Details/?listId={0}&generate={1}";
            urlTemplate = string.Format(urlTemplate, listId,generate);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ListsFacade
    {
        private IRestClient restClient;

        public ListsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<Lists>> GetAll()
        {
            return await restClient.AtUrl("Finance/Lists/").Get<Lists>();
        }

        /// <summary>
        /// Get a single List without contents.
        /// </summary>
        /// <param name="listId"></param>
        /// <returns></returns>
        public async Task<RestResponse<List>> Get(string listId = "")
        {
             var urlTemplate = "Finance/Lists/{0}";
             urlTemplate = string.Format(urlTemplate, listId);
            return await restClient.AtUrl(urlTemplate).Get<List>();
        }

        /// <summary>
        /// Generate a List.
        /// </summary>
        /// <param name="listId"></param>
        public async Task<RestResponse<NoResponse>> Generate(string listId)
        {
             var urlTemplate = "Finance/Lists/{0}/Generate";
             urlTemplate = string.Format(urlTemplate, listId);
            return await restClient.AtUrl(urlTemplate).Post<string, NoResponse>(listId);
        }

        /// <summary>
        /// Create a List.
        /// </summary>
        /// <param name="list"></param>
        public async Task<RestResponse<List>> Create(List list)
        {
            return await restClient.AtUrl("Finance/Lists/").Post<List, List>(list);
        }

        /// <summary>
        /// Update an existing List.
        /// </summary>
        /// <param name="listId"></param>
        /// <param name="list"></param>
        public async Task<RestResponse<List>> Update(string listId, List list)
        {
             var urlTemplate = "Finance/Lists/{0}";
             urlTemplate = string.Format(urlTemplate, listId);
            return await restClient.AtUrl(urlTemplate).Put<List, List>(list);
        }

    }
 

 
    /// 
    public class ListsFacadeBatch
    {
        private IRestClient restClient;

        public ListsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Lists";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "Finance/Lists/";

            return bRequest;
        }

        /// <summary>
        /// Get a single List without contents.
        /// </summary>
        /// <param name="listId"></param>
        /// <returns></returns>
        public Request Get(string listId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.List";
            bRequest.Content = null;

            var urlTemplate = "Finance/Lists/{0}";
            urlTemplate = string.Format(urlTemplate, listId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Generate a List.
        /// </summary>
        /// <param name="listId"></param>
        public Request Generate(string listId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = listId;

            var urlTemplate = "Finance/Lists/{0}/Generate";
            urlTemplate = string.Format(urlTemplate, listId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a List.
        /// </summary>
        /// <param name="list"></param>
        public Request Create(List list, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.List";
            bRequest.Content = list;

            bRequest.Uri = restClient.GetBaseUrl() + "Finance/Lists/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing List.
        /// </summary>
        /// <param name="listId"></param>
        /// <param name="list"></param>
        public Request Update(string listId, List list, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.List";
            bRequest.Content = list;

            var urlTemplate = "Finance/Lists/{0}";
            urlTemplate = string.Format(urlTemplate, listId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class MembershipLevelsFacade
    {
        private IRestClient restClient;

        public MembershipLevelsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get a list of membership levels. MembershipOrgId is required.
        /// </summary>
        /// <param name="membershipOrgId"></param>
        /// <returns></returns>
        public async Task<RestResponse<MembershipLevelSummaries>> GetAllSummaries(string membershipOrgId = "")
        {
            var urlTemplate = "Finance/MembershipLevels/Summary/?membershipOrgId={0}";
            urlTemplate = string.Format(urlTemplate, membershipOrgId);
            return await restClient.AtUrl(urlTemplate).Get<MembershipLevelSummaries>();
        }

        /// <summary>
        /// Get a summary list of all membership levels. MembershipOrgId is required.
        /// </summary>
        /// <param name="membershipOrgId"></param>
        /// <returns></returns>
        public async Task<RestResponse<MembershipLevels>> GetAll(string membershipOrgId = "")
        {
            var urlTemplate = "Finance/MembershipLevels/?membershipOrgId={0}";
            urlTemplate = string.Format(urlTemplate, membershipOrgId);
            return await restClient.AtUrl(urlTemplate).Get<MembershipLevels>();
        }

        /// <summary>
        /// Get a specific membership level.
        /// </summary>
        /// <param name="membershipLevelId"></param>
        /// <returns></returns>
        public async Task<RestResponse<MembershipLevel>> Get(string membershipLevelId = "")
        {
             var urlTemplate = "Finance/MembershipLevels/{0}";
             urlTemplate = string.Format(urlTemplate, membershipLevelId);
            return await restClient.AtUrl(urlTemplate).Get<MembershipLevel>();
        }

    }
 

 
    /// 
    public class MembershipLevelsFacadeBatch
    {
        private IRestClient restClient;

        public MembershipLevelsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get a list of membership levels. MembershipOrgId is required.
        /// </summary>
        /// <param name="membershipOrgId"></param>
        /// <returns></returns>
        public Request GetAllSummaries(string membershipOrgId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MembershipLevelSummaries";
            bRequest.Content = null;

            var urlTemplate = "Finance/MembershipLevels/Summary/?membershipOrgId={0}";
            urlTemplate = string.Format(urlTemplate, membershipOrgId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get a summary list of all membership levels. MembershipOrgId is required.
        /// </summary>
        /// <param name="membershipOrgId"></param>
        /// <returns></returns>
        public Request GetAll(string membershipOrgId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MembershipLevels";
            bRequest.Content = null;

            var urlTemplate = "Finance/MembershipLevels/?membershipOrgId={0}";
            urlTemplate = string.Format(urlTemplate, membershipOrgId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get a specific membership level.
        /// </summary>
        /// <param name="membershipLevelId"></param>
        /// <returns></returns>
        public Request Get(string membershipLevelId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MembershipLevel";
            bRequest.Content = null;

            var urlTemplate = "Finance/MembershipLevels/{0}";
            urlTemplate = string.Format(urlTemplate, membershipLevelId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class MembershipOrganizationsFacade
    {
        private IRestClient restClient;

        public MembershipOrganizationsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<MembershipOrganizations>> GetAll()
        {
            return await restClient.AtUrl("Finance/MembershipOrganizations/").Get<MembershipOrganizations>();
        }

        /// 
        public async Task<RestResponse<MembershipOrganizationSummaries>> GetAllSummaries()
        {
            return await restClient.AtUrl("Finance/MembershipOrganizations/Summary/").Get<MembershipOrganizationSummaries>();
        }

        /// <summary>
        /// Get a specific membership organization.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<MembershipOrganization>> Get(string id = "")
        {
             var urlTemplate = "Finance/MembershipOrganizations/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Get<MembershipOrganization>();
        }

    }
 

 
    /// 
    public class MembershipOrganizationsFacadeBatch
    {
        private IRestClient restClient;

        public MembershipOrganizationsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MembershipOrganizations";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "Finance/MembershipOrganizations/";

            return bRequest;
        }

        /// 
        public Request GetAllSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MembershipOrganizationSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "Finance/MembershipOrganizations/Summary/";

            return bRequest;
        }

        /// <summary>
        /// Get a specific membership organization.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MembershipOrganization";
            bRequest.Content = null;

            var urlTemplate = "Finance/MembershipOrganizations/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PlansFacade
    {
        private IRestClient restClient;

        public PlansFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the plans for the specified constituent, campaign, worker or fund.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="campaignId"></param>
        /// <param name="fundId"></param>
        /// <param name="onlyNullFund"></param>
        /// <param name="contributionDesignationId"></param>
        /// <param name="workerId"></param>
        /// <param name="includeAffiliations"></param>
        /// <param name="includeAssociates"></param>
        /// <param name="listId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Plans>> GetAll(string constituentId = "null", string campaignId = "null", string fundId = "null", string onlyNullFund = "null", string contributionDesignationId = "null", string workerId = "null", string includeAffiliations = "null", string includeAssociates = "null", string listId = "null")
        {
            var urlTemplate = "Finance/Plans/?constituentId={0}&campaignId={1}&fundId={2}&onlyNullFund={3}&contributionDesignationId={4}&workerId={5}&includeAffiliations={6}&includeAssociates={7}&listId={8}";
            urlTemplate = string.Format(urlTemplate, constituentId,campaignId,fundId,onlyNullFund,contributionDesignationId,workerId,includeAffiliations,includeAssociates,listId);
            return await restClient.AtUrl(urlTemplate).Get<Plans>();
        }

        /// <summary>
        /// Get details of a plan.
        /// </summary>
        /// <param name="planId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Plan>> Get(string planId)
        {
             var urlTemplate = "Finance/Plans/{0}";
             urlTemplate = string.Format(urlTemplate, planId);
            return await restClient.AtUrl(urlTemplate).Get<Plan>();
        }

        /// <summary>
        /// Create a new plan.
        /// </summary>
        /// <param name="plan"></param>
        /// <returns></returns>
        public async Task<RestResponse<Plan>> Create(Plan plan)
        {
            return await restClient.AtUrl("Finance/Plans/").Post<Plan, Plan>(plan);
        }

        /// <summary>
        /// Update an existing plan.
        /// </summary>
        /// <param name="planId"></param>
        /// <param name="plan"></param>
        /// <returns></returns>
        public async Task<RestResponse<Plan>> Update(string planId, Plan plan)
        {
             var urlTemplate = "Finance/Plans/{0}";
             urlTemplate = string.Format(urlTemplate, planId);
            return await restClient.AtUrl(urlTemplate).Put<Plan, Plan>(plan);
        }

        /// <summary>
        /// Delete a plan.
        /// </summary>
        /// <param name="planId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string planId)
        {
             var urlTemplate = "Finance/Plans/{0}";
             urlTemplate = string.Format(urlTemplate, planId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PlansFacadeBatch
    {
        private IRestClient restClient;

        public PlansFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the plans for the specified constituent, campaign, worker or fund.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="campaignId"></param>
        /// <param name="fundId"></param>
        /// <param name="onlyNullFund"></param>
        /// <param name="contributionDesignationId"></param>
        /// <param name="workerId"></param>
        /// <param name="includeAffiliations"></param>
        /// <param name="includeAssociates"></param>
        /// <param name="listId"></param>
        /// <returns></returns>
        public Request GetAll(string constituentId = "null", string campaignId = "null", string fundId = "null", string onlyNullFund = "null", string contributionDesignationId = "null", string workerId = "null", string includeAffiliations = "null", string includeAssociates = "null", string listId = "null", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Plans";
            bRequest.Content = null;

            var urlTemplate = "Finance/Plans/?constituentId={0}&campaignId={1}&fundId={2}&onlyNullFund={3}&contributionDesignationId={4}&workerId={5}&includeAffiliations={6}&includeAssociates={7}&listId={8}";
            urlTemplate = string.Format(urlTemplate, constituentId,campaignId,fundId,onlyNullFund,contributionDesignationId,workerId,includeAffiliations,includeAssociates,listId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a plan.
        /// </summary>
        /// <param name="planId"></param>
        /// <returns></returns>
        public Request Get(string planId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Plan";
            bRequest.Content = null;

            var urlTemplate = "Finance/Plans/{0}";
            urlTemplate = string.Format(urlTemplate, planId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new plan.
        /// </summary>
        /// <param name="plan"></param>
        /// <returns></returns>
        public Request Create(Plan plan, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Plan";
            bRequest.Content = plan;

            bRequest.Uri = restClient.GetBaseUrl() + "Finance/Plans/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing plan.
        /// </summary>
        /// <param name="planId"></param>
        /// <param name="plan"></param>
        /// <returns></returns>
        public Request Update(string planId, Plan plan, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Plan";
            bRequest.Content = plan;

            var urlTemplate = "Finance/Plans/{0}";
            urlTemplate = string.Format(urlTemplate, planId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete a plan.
        /// </summary>
        /// <param name="planId"></param>
        public Request Delete(string planId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Finance/Plans/{0}";
            urlTemplate = string.Format(urlTemplate, planId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PlanWorkersFacade
    {
        private IRestClient restClient;

        public PlanWorkersFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the plan workers for the specified constituent.
        /// </summary>
        /// <param name="planId"></param>
        /// <returns></returns>
        public async Task<RestResponse<PlanWorkers>> GetAll(string planId = "")
        {
            var urlTemplate = "Finance/PlanWorkers/?planId={0}";
            urlTemplate = string.Format(urlTemplate, planId);
            return await restClient.AtUrl(urlTemplate).Get<PlanWorkers>();
        }

        /// <summary>
        /// Get details of a plan worker.
        /// </summary>
        /// <param name="planWorkerId"></param>
        /// <returns></returns>
        public async Task<RestResponse<PlanWorker>> Get(string planWorkerId = "")
        {
             var urlTemplate = "Finance/PlanWorkers/{0}";
             urlTemplate = string.Format(urlTemplate, planWorkerId);
            return await restClient.AtUrl(urlTemplate).Get<PlanWorker>();
        }

        /// <summary>
        /// Create a new plan worker.
        /// </summary>
        /// <param name="planWorker"></param>
        /// <returns></returns>
        public async Task<RestResponse<PlanWorker>> Create(PlanWorker planWorker)
        {
            return await restClient.AtUrl("Finance/PlanWorkers/").Post<PlanWorker, PlanWorker>(planWorker);
        }

        /// <summary>
        /// Update an existing plan worker.
        /// </summary>
        /// <param name="planWorkerId"></param>
        /// <param name="planWorker"></param>
        /// <returns></returns>
        public async Task<RestResponse<PlanWorker>> Update(string planWorkerId, PlanWorker planWorker)
        {
             var urlTemplate = "Finance/PlanWorkers/{0}";
             urlTemplate = string.Format(urlTemplate, planWorkerId);
            return await restClient.AtUrl(urlTemplate).Put<PlanWorker, PlanWorker>(planWorker);
        }

        /// <summary>
        /// Delete a plan worker.
        /// </summary>
        /// <param name="planWorkerId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string planWorkerId)
        {
             var urlTemplate = "Finance/PlanWorkers/{0}";
             urlTemplate = string.Format(urlTemplate, planWorkerId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PlanWorkersFacadeBatch
    {
        private IRestClient restClient;

        public PlanWorkersFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the plan workers for the specified constituent.
        /// </summary>
        /// <param name="planId"></param>
        /// <returns></returns>
        public Request GetAll(string planId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PlanWorkers";
            bRequest.Content = null;

            var urlTemplate = "Finance/PlanWorkers/?planId={0}";
            urlTemplate = string.Format(urlTemplate, planId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a plan worker.
        /// </summary>
        /// <param name="planWorkerId"></param>
        /// <returns></returns>
        public Request Get(string planWorkerId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PlanWorker";
            bRequest.Content = null;

            var urlTemplate = "Finance/PlanWorkers/{0}";
            urlTemplate = string.Format(urlTemplate, planWorkerId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new plan worker.
        /// </summary>
        /// <param name="planWorker"></param>
        /// <returns></returns>
        public Request Create(PlanWorker planWorker, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PlanWorker";
            bRequest.Content = planWorker;

            bRequest.Uri = restClient.GetBaseUrl() + "Finance/PlanWorkers/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing plan worker.
        /// </summary>
        /// <param name="planWorkerId"></param>
        /// <param name="planWorker"></param>
        /// <returns></returns>
        public Request Update(string planWorkerId, PlanWorker planWorker, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PlanWorker";
            bRequest.Content = planWorker;

            var urlTemplate = "Finance/PlanWorkers/{0}";
            urlTemplate = string.Format(urlTemplate, planWorkerId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete a plan worker.
        /// </summary>
        /// <param name="planWorkerId"></param>
        public Request Delete(string planWorkerId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Finance/PlanWorkers/{0}";
            urlTemplate = string.Format(urlTemplate, planWorkerId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PortfoliosFacade
    {
        private IRestClient restClient;

        public PortfoliosFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get portfolio for a constituent.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="primaryOnly"></param>
        /// <param name="statusIds"></param>
        /// <param name="workerRoleIds"></param>
        /// <param name="page"></param>
        /// <param name="pageSize"></param>
        /// <param name="portfolioCustomColumns"></param>
        /// <param name="planCustomColumns"></param>
        /// <returns></returns>
        public async Task<RestResponse<Portfolio>> Get(string constituentId = "", string primaryOnly = "", string statusIds = "", string workerRoleIds = "", string page = "", string pageSize = "", string portfolioCustomColumns = "", string planCustomColumns = "")
        {
            var urlTemplate = "Finance/Portfolios/?constituentId={0}&primaryOnly={1}&statusIds={2}&workerRoleIds={3}&page={4}&pageSize={5}&portfolioCustomColumns={6}&planCustomColumns={7}";
            urlTemplate = string.Format(urlTemplate, constituentId,primaryOnly,statusIds,workerRoleIds,page,pageSize,portfolioCustomColumns,planCustomColumns);
            return await restClient.AtUrl(urlTemplate).Get<Portfolio>();
        }

        /// <summary>
        /// Get details of a portfolio entry for a plan.
        /// </summary>
        /// <param name="planId"></param>
        /// <returns></returns>
        public async Task<RestResponse<PortfolioPlan>> GetPortfolioEntry(string planId = "")
        {
            var urlTemplate = "Finance/Portfolios/Entries/?planId={0}";
            urlTemplate = string.Format(urlTemplate, planId);
            return await restClient.AtUrl(urlTemplate).Get<PortfolioPlan>();
        }

    }
 

 
    /// 
    public class PortfoliosFacadeBatch
    {
        private IRestClient restClient;

        public PortfoliosFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get portfolio for a constituent.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="primaryOnly"></param>
        /// <param name="statusIds"></param>
        /// <param name="workerRoleIds"></param>
        /// <param name="page"></param>
        /// <param name="pageSize"></param>
        /// <param name="portfolioCustomColumns"></param>
        /// <param name="planCustomColumns"></param>
        /// <returns></returns>
        public Request Get(string constituentId = "", string primaryOnly = "", string statusIds = "", string workerRoleIds = "", string page = "", string pageSize = "", string portfolioCustomColumns = "", string planCustomColumns = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Portfolio";
            bRequest.Content = null;

            var urlTemplate = "Finance/Portfolios/?constituentId={0}&primaryOnly={1}&statusIds={2}&workerRoleIds={3}&page={4}&pageSize={5}&portfolioCustomColumns={6}&planCustomColumns={7}";
            urlTemplate = string.Format(urlTemplate, constituentId,primaryOnly,statusIds,workerRoleIds,page,pageSize,portfolioCustomColumns,planCustomColumns);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a portfolio entry for a plan.
        /// </summary>
        /// <param name="planId"></param>
        /// <returns></returns>
        public Request GetPortfolioEntry(string planId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PortfolioPlan";
            bRequest.Content = null;

            var urlTemplate = "Finance/Portfolios/Entries/?planId={0}";
            urlTemplate = string.Format(urlTemplate, planId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class SourcesFacade
    {
        private IRestClient restClient;

        public SourcesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get summary of all Sources.
        /// </summary>
        /// <param name="appealIds"></param>
        /// <returns></returns>
        public async Task<RestResponse<SourceSummaries>> GetAllSummaries(string appealIds = "")
        {
            var urlTemplate = "Finance/Sources/Summary/?appealIds={0}";
            urlTemplate = string.Format(urlTemplate, appealIds);
            return await restClient.AtUrl(urlTemplate).Get<SourceSummaries>();
        }

        /// <summary>
        /// Get details of a Source.
        /// </summary>
        /// <param name="sourceId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Source>> Get(string sourceId = "")
        {
             var urlTemplate = "Finance/Sources/{0}";
             urlTemplate = string.Format(urlTemplate, sourceId);
            return await restClient.AtUrl(urlTemplate).Get<Source>();
        }

    }
 

 
    /// 
    public class SourcesFacadeBatch
    {
        private IRestClient restClient;

        public SourcesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get summary of all Sources.
        /// </summary>
        /// <param name="appealIds"></param>
        /// <returns></returns>
        public Request GetAllSummaries(string appealIds = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SourceSummaries";
            bRequest.Content = null;

            var urlTemplate = "Finance/Sources/Summary/?appealIds={0}";
            urlTemplate = string.Format(urlTemplate, appealIds);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a Source.
        /// </summary>
        /// <param name="sourceId"></param>
        /// <returns></returns>
        public Request Get(string sourceId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Source";
            bRequest.Content = null;

            var urlTemplate = "Finance/Sources/{0}";
            urlTemplate = string.Format(urlTemplate, sourceId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class StepsFacade
    {
        private IRestClient restClient;

        public StepsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the steps for the specified plan, constituent or associate.
        /// </summary>
        /// <param name="planId"></param>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <param name="associateId"></param>
        /// <param name="includeAssociates"></param>
        /// <returns></returns>
        public async Task<RestResponse<Steps>> GetAll(string planId = "", string constituentId = "", string includeAffiliations = "", string associateId = "", string includeAssociates = "")
        {
            var urlTemplate = "Finance/Steps/?planId={0}&constituentId={1}&includeAffiliations={2}&associateId={3}&includeAssociates={4}";
            urlTemplate = string.Format(urlTemplate, planId,constituentId,includeAffiliations,associateId,includeAssociates);
            return await restClient.AtUrl(urlTemplate).Get<Steps>();
        }

        /// <summary>
        /// Get details of a step.
        /// </summary>
        /// <param name="stepId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Step>> Get(string stepId = "")
        {
             var urlTemplate = "Finance/Steps/{0}";
             urlTemplate = string.Format(urlTemplate, stepId);
            return await restClient.AtUrl(urlTemplate).Get<Step>();
        }

        /// <summary>
        /// Create a new step.
        /// </summary>
        /// <param name="step"></param>
        /// <returns></returns>
        public async Task<RestResponse<Step>> Create(Step step)
        {
            return await restClient.AtUrl("Finance/Steps/").Post<Step, Step>(step);
        }

        /// <summary>
        /// Update an existing step.
        /// </summary>
        /// <param name="stepId"></param>
        /// <param name="step"></param>
        /// <returns></returns>
        public async Task<RestResponse<Step>> Update(string stepId, Step step)
        {
             var urlTemplate = "Finance/Steps/{0}";
             urlTemplate = string.Format(urlTemplate, stepId);
            return await restClient.AtUrl(urlTemplate).Put<Step, Step>(step);
        }

        /// <summary>
        /// Delete a step.
        /// </summary>
        /// <param name="stepId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string stepId)
        {
             var urlTemplate = "Finance/Steps/{0}";
             urlTemplate = string.Format(urlTemplate, stepId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Add a document to the step.
        /// </summary>
        /// <param name="stepId"></param>
        /// <param name="document"></param>
        /// <returns></returns>
        public async Task<RestResponse<DocumentSummary>> AddDocument(string stepId, Document document)
        {
             var urlTemplate = "Finance/Steps/{0}/Documents/";
             urlTemplate = string.Format(urlTemplate, stepId);
            return await restClient.AtUrl(urlTemplate).Post<Document, DocumentSummary>(document);
        }

        /// <summary>
        /// Update a document attached to a step.
        /// </summary>
        /// <param name="stepId"></param>
        /// <param name="documentId"></param>
        /// <param name="document"></param>
        /// <returns></returns>
        public async Task<RestResponse<DocumentSummary>> UpdateDocument(string stepId, string documentId, Document document)
        {
             var urlTemplate = "Finance/Steps/{0}/Documents/{1}";
             urlTemplate = string.Format(urlTemplate, stepId, documentId);
            return await restClient.AtUrl(urlTemplate).Put<Document, DocumentSummary>(document);
        }

        /// <summary>
        /// Get all the documents associated with the step (Including the file contents).
        /// </summary>
        /// <param name="stepId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Documents>> GetAllDocuments(string stepId = "")
        {
             var urlTemplate = "Finance/Steps/{0}/Documents/";
             urlTemplate = string.Format(urlTemplate, stepId);
            return await restClient.AtUrl(urlTemplate).Get<Documents>();
        }

        /// <summary>
        /// Get summary of all the documents associated with the step. (Excluding the file contents)
        /// </summary>
        /// <param name="stepId"></param>
        /// <returns></returns>
        public async Task<RestResponse<DocumentSummaries>> GetAllDocumentSummaries(string stepId = "")
        {
             var urlTemplate = "Finance/Steps/{0}/Documents/Summary/";
             urlTemplate = string.Format(urlTemplate, stepId);
            return await restClient.AtUrl(urlTemplate).Get<DocumentSummaries>();
        }

    }
 

 
    /// 
    public class StepsFacadeBatch
    {
        private IRestClient restClient;

        public StepsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the steps for the specified plan, constituent or associate.
        /// </summary>
        /// <param name="planId"></param>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <param name="associateId"></param>
        /// <param name="includeAssociates"></param>
        /// <returns></returns>
        public Request GetAll(string planId = "", string constituentId = "", string includeAffiliations = "", string associateId = "", string includeAssociates = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Steps";
            bRequest.Content = null;

            var urlTemplate = "Finance/Steps/?planId={0}&constituentId={1}&includeAffiliations={2}&associateId={3}&includeAssociates={4}";
            urlTemplate = string.Format(urlTemplate, planId,constituentId,includeAffiliations,associateId,includeAssociates);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a step.
        /// </summary>
        /// <param name="stepId"></param>
        /// <returns></returns>
        public Request Get(string stepId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Step";
            bRequest.Content = null;

            var urlTemplate = "Finance/Steps/{0}";
            urlTemplate = string.Format(urlTemplate, stepId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new step.
        /// </summary>
        /// <param name="step"></param>
        /// <returns></returns>
        public Request Create(Step step, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Step";
            bRequest.Content = step;

            bRequest.Uri = restClient.GetBaseUrl() + "Finance/Steps/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing step.
        /// </summary>
        /// <param name="stepId"></param>
        /// <param name="step"></param>
        /// <returns></returns>
        public Request Update(string stepId, Step step, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Step";
            bRequest.Content = step;

            var urlTemplate = "Finance/Steps/{0}";
            urlTemplate = string.Format(urlTemplate, stepId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete a step.
        /// </summary>
        /// <param name="stepId"></param>
        public Request Delete(string stepId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Finance/Steps/{0}";
            urlTemplate = string.Format(urlTemplate, stepId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Add a document to the step.
        /// </summary>
        /// <param name="stepId"></param>
        /// <param name="document"></param>
        /// <returns></returns>
        public Request AddDocument(string stepId, Document document, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DocumentSummary";
            bRequest.Content = document;

            var urlTemplate = "Finance/Steps/{0}/Documents/";
            urlTemplate = string.Format(urlTemplate, stepId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Update a document attached to a step.
        /// </summary>
        /// <param name="stepId"></param>
        /// <param name="documentId"></param>
        /// <param name="document"></param>
        /// <returns></returns>
        public Request UpdateDocument(string stepId, string documentId, Document document, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DocumentSummary";
            bRequest.Content = document;

            var urlTemplate = "Finance/Steps/{0}/Documents/{1}";
            urlTemplate = string.Format(urlTemplate, stepId, documentId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get all the documents associated with the step (Including the file contents).
        /// </summary>
        /// <param name="stepId"></param>
        /// <returns></returns>
        public Request GetAllDocuments(string stepId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Documents";
            bRequest.Content = null;

            var urlTemplate = "Finance/Steps/{0}/Documents/";
            urlTemplate = string.Format(urlTemplate, stepId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get summary of all the documents associated with the step. (Excluding the file contents)
        /// </summary>
        /// <param name="stepId"></param>
        /// <returns></returns>
        public Request GetAllDocumentSummaries(string stepId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DocumentSummaries";
            bRequest.Content = null;

            var urlTemplate = "Finance/Steps/{0}/Documents/Summary/";
            urlTemplate = string.Format(urlTemplate, stepId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class WorkersFacade
    {
        private IRestClient restClient;

        public WorkersFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the workers for the specified constituent.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public async Task<RestResponse<Workers>> GetAll(string constituentId = "", string includeAffiliations = "")
        {
            var urlTemplate = "Finance/Workers/?constituentId={0}&includeAffiliations={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations);
            return await restClient.AtUrl(urlTemplate).Get<Workers>();
        }

        /// <summary>
        /// Get summary of all the workers for the specified constituent.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public async Task<RestResponse<WorkerSummaries>> GetAllSummaries(string constituentId = "", string includeAffiliations = "")
        {
            var urlTemplate = "Finance/Workers/Summary?constituentId={0}&includeAffiliations={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations);
            return await restClient.AtUrl(urlTemplate).Get<WorkerSummaries>();
        }

        /// <summary>
        /// Get details of a worker.
        /// </summary>
        /// <param name="workerId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Worker>> Get(string workerId = "")
        {
             var urlTemplate = "Finance/Workers/{0}";
             urlTemplate = string.Format(urlTemplate, workerId);
            return await restClient.AtUrl(urlTemplate).Get<Worker>();
        }

        /// <summary>
        /// Create a new worker.
        /// </summary>
        /// <param name="worker"></param>
        /// <returns></returns>
        public async Task<RestResponse<Worker>> Create(Worker worker)
        {
            return await restClient.AtUrl("Finance/Workers/").Post<Worker, Worker>(worker);
        }

        /// <summary>
        /// Update an existing worker.
        /// </summary>
        /// <param name="workerId"></param>
        /// <param name="worker"></param>
        /// <returns></returns>
        public async Task<RestResponse<Worker>> Update(string workerId, Worker worker)
        {
             var urlTemplate = "Finance/Workers/{0}";
             urlTemplate = string.Format(urlTemplate, workerId);
            return await restClient.AtUrl(urlTemplate).Put<Worker, Worker>(worker);
        }

        /// <summary>
        /// Delete a worker.
        /// </summary>
        /// <param name="workerId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string workerId)
        {
             var urlTemplate = "Finance/Workers/{0}";
             urlTemplate = string.Format(urlTemplate, workerId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class WorkersFacadeBatch
    {
        private IRestClient restClient;

        public WorkersFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of all the workers for the specified constituent.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public Request GetAll(string constituentId = "", string includeAffiliations = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Workers";
            bRequest.Content = null;

            var urlTemplate = "Finance/Workers/?constituentId={0}&includeAffiliations={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get summary of all the workers for the specified constituent.
        /// </summary>
        /// <param name="constituentId"></param>
        /// <param name="includeAffiliations"></param>
        /// <returns></returns>
        public Request GetAllSummaries(string constituentId = "", string includeAffiliations = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WorkerSummaries";
            bRequest.Content = null;

            var urlTemplate = "Finance/Workers/Summary?constituentId={0}&includeAffiliations={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,includeAffiliations);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a worker.
        /// </summary>
        /// <param name="workerId"></param>
        /// <returns></returns>
        public Request Get(string workerId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Worker";
            bRequest.Content = null;

            var urlTemplate = "Finance/Workers/{0}";
            urlTemplate = string.Format(urlTemplate, workerId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new worker.
        /// </summary>
        /// <param name="worker"></param>
        /// <returns></returns>
        public Request Create(Worker worker, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Worker";
            bRequest.Content = worker;

            bRequest.Uri = restClient.GetBaseUrl() + "Finance/Workers/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing worker.
        /// </summary>
        /// <param name="workerId"></param>
        /// <param name="worker"></param>
        /// <returns></returns>
        public Request Update(string workerId, Worker worker, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Worker";
            bRequest.Content = worker;

            var urlTemplate = "Finance/Workers/{0}";
            urlTemplate = string.Format(urlTemplate, workerId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete a worker.
        /// </summary>
        /// <param name="workerId"></param>
        public Request Delete(string workerId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Finance/Workers/{0}";
            urlTemplate = string.Format(urlTemplate, workerId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class AuthorizationFacade
    {
        private IRestClient restClient;

        public AuthorizationFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Authorize a payment using a manually keyed, swiped or encrypted card data.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<AuthorizationResponse>> Authorize(AuthorizationRequest request)
        {
            return await restClient.AtUrl("PaymentGateway/Authorization/Authorize").Post<AuthorizationRequest, AuthorizationResponse>(request);
        }

        /// <summary>
        /// Confirm an authorization using it's reference number.
        /// </summary>
        /// <param name="referenceNumber"></param>
        /// <param name="confirmAuthorizationRequest"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConfirmAuthorizationResponse>> Confirm(string referenceNumber, ConfirmAuthorizationRequest confirmAuthorizationRequest)
        {
             var urlTemplate = "PaymentGateway/Authorization/{0}/Confirm";
             urlTemplate = string.Format(urlTemplate, referenceNumber);
            return await restClient.AtUrl(urlTemplate).Post<ConfirmAuthorizationRequest, ConfirmAuthorizationResponse>(confirmAuthorizationRequest);
        }

        /// <summary>
        /// Reverse an authorization using it's reference number.
        /// </summary>
        /// <param name="referenceNumber"></param>
        /// <param name="reversalRequest"></param>
        /// <returns></returns>
        public async Task<RestResponse<ReversalResponse>> Reverse(string referenceNumber, ReversalRequest reversalRequest)
        {
             var urlTemplate = "PaymentGateway/Authorization/{0}/Reverse";
             urlTemplate = string.Format(urlTemplate, referenceNumber);
            return await restClient.AtUrl(urlTemplate).Post<ReversalRequest, ReversalResponse>(reversalRequest);
        }

    }
 

 
    /// 
    public class AuthorizationFacadeBatch
    {
        private IRestClient restClient;

        public AuthorizationFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Authorize a payment using a manually keyed, swiped or encrypted card data.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request Authorize(AuthorizationRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AuthorizationResponse";
            bRequest.Content = request;

            bRequest.Uri = restClient.GetBaseUrl() + "PaymentGateway/Authorization/Authorize";

            return bRequest;
        }

        /// <summary>
        /// Confirm an authorization using it's reference number.
        /// </summary>
        /// <param name="referenceNumber"></param>
        /// <param name="confirmAuthorizationRequest"></param>
        /// <returns></returns>
        public Request Confirm(string referenceNumber, ConfirmAuthorizationRequest confirmAuthorizationRequest, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConfirmAuthorizationResponse";
            bRequest.Content = confirmAuthorizationRequest;

            var urlTemplate = "PaymentGateway/Authorization/{0}/Confirm";
            urlTemplate = string.Format(urlTemplate, referenceNumber);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Reverse an authorization using it's reference number.
        /// </summary>
        /// <param name="referenceNumber"></param>
        /// <param name="reversalRequest"></param>
        /// <returns></returns>
        public Request Reverse(string referenceNumber, ReversalRequest reversalRequest, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ReversalResponse";
            bRequest.Content = reversalRequest;

            var urlTemplate = "PaymentGateway/Authorization/{0}/Reverse";
            urlTemplate = string.Format(urlTemplate, referenceNumber);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ConfigurationFacade
    {
        private IRestClient restClient;

        public ConfigurationFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<PaymentGatewayConfiguration>> GetConfiguration()
        {
            return await restClient.AtUrl("PaymentGateway/Configuration/").Get<PaymentGatewayConfiguration>();
        }

    }
 

 
    /// 
    public class ConfigurationFacadeBatch
    {
        private IRestClient restClient;

        public ConfigurationFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetConfiguration(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentGatewayConfiguration";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "PaymentGateway/Configuration/";

            return bRequest;
        }

    }
 

 
    /// 
    public class PaymentGatewayAccountsFacade
    {
        private IRestClient restClient;

        public PaymentGatewayAccountsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<PaymentAccountResponse>> StoreToken(AccountTokenRequest request)
        {
            return await restClient.AtUrl("PaymentGateway/Accounts/Token").Post<AccountTokenRequest, PaymentAccountResponse>(request);
        }

        /// 
        public async Task<RestResponse<PaymentAccountResponse>> CreateAccount(AccountReferenceNumberRequest request)
        {
            return await restClient.AtUrl("PaymentGateway/Accounts/ReferenceNumber").Post<AccountReferenceNumberRequest, PaymentAccountResponse>(request);
        }

    }
 

 
    /// 
    public class PaymentGatewayAccountsFacadeBatch
    {
        private IRestClient restClient;

        public PaymentGatewayAccountsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request StoreToken(AccountTokenRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentAccountResponse";
            bRequest.Content = request;

            bRequest.Uri = restClient.GetBaseUrl() + "PaymentGateway/Accounts/Token";

            return bRequest;
        }

        /// 
        public Request CreateAccount(AccountReferenceNumberRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentAccountResponse";
            bRequest.Content = request;

            bRequest.Uri = restClient.GetBaseUrl() + "PaymentGateway/Accounts/ReferenceNumber";

            return bRequest;
        }

    }
 

 
    /// 
    public class PaymentGatewayActivitiesFacade
    {
        private IRestClient restClient;

        public PaymentGatewayActivitiesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<PaymentGatewayActivities>> GetAll()
        {
            return await restClient.AtUrl("PaymentGateway/PaymentGatewayActivities/").Get<PaymentGatewayActivities>();
        }

        /// 
        public async Task<RestResponse<PaymentGatewayActivity>> Get(string paymentGatewayActivityId)
        {
             var urlTemplate = "PaymentGateway/PaymentGatewayActivities/{0}";
             urlTemplate = string.Format(urlTemplate, paymentGatewayActivityId);
            return await restClient.AtUrl(urlTemplate).Get<PaymentGatewayActivity>();
        }

        /// 
        public async Task<RestResponse<PaymentGatewayActivity>> Create(PaymentGatewayActivity paymentGatewayActivity)
        {
            return await restClient.AtUrl("PaymentGateway/PaymentGatewayActivities/").Post<PaymentGatewayActivity, PaymentGatewayActivity>(paymentGatewayActivity);
        }

        /// 
        public async Task<RestResponse<PaymentGatewayActivity>> Update(string paymentGatewayActivityId, PaymentGatewayActivity paymentGatewayActivity)
        {
             var urlTemplate = "PaymentGateway/PaymentGatewayActivities/{0}";
             urlTemplate = string.Format(urlTemplate, paymentGatewayActivityId);
            return await restClient.AtUrl(urlTemplate).Put<PaymentGatewayActivity, PaymentGatewayActivity>(paymentGatewayActivity);
        }

        /// 
        public async Task<RestResponse<NoResponse>> Delete(string paymentGatewayActivityId)
        {
             var urlTemplate = "PaymentGateway/PaymentGatewayActivities/{0}";
             urlTemplate = string.Format(urlTemplate, paymentGatewayActivityId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PaymentGatewayActivitiesFacadeBatch
    {
        private IRestClient restClient;

        public PaymentGatewayActivitiesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentGatewayActivities";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "PaymentGateway/PaymentGatewayActivities/";

            return bRequest;
        }

        /// 
        public Request Get(string paymentGatewayActivityId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentGatewayActivity";
            bRequest.Content = null;

            var urlTemplate = "PaymentGateway/PaymentGatewayActivities/{0}";
            urlTemplate = string.Format(urlTemplate, paymentGatewayActivityId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Create(PaymentGatewayActivity paymentGatewayActivity, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentGatewayActivity";
            bRequest.Content = paymentGatewayActivity;

            bRequest.Uri = restClient.GetBaseUrl() + "PaymentGateway/PaymentGatewayActivities/";

            return bRequest;
        }

        /// 
        public Request Update(string paymentGatewayActivityId, PaymentGatewayActivity paymentGatewayActivity, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentGatewayActivity";
            bRequest.Content = paymentGatewayActivity;

            var urlTemplate = "PaymentGateway/PaymentGatewayActivities/{0}";
            urlTemplate = string.Format(urlTemplate, paymentGatewayActivityId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Delete(string paymentGatewayActivityId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "PaymentGateway/PaymentGatewayActivities/{0}";
            urlTemplate = string.Format(urlTemplate, paymentGatewayActivityId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class AccountTypesFacade
    {
        private IRestClient restClient;

        public AccountTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all account types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<AccountTypes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/AccountTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<AccountTypes>();
        }

        /// 
        public async Task<RestResponse<AccountTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/AccountTypes/Summary").Get<AccountTypeSummaries>();
        }

        /// <summary>
        /// Get the details of an account type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<AccountType>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/AccountTypes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<AccountType>();
        }

        /// <summary>
        /// Create a new account type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<AccountType>> Create(AccountType data)
        {
            return await restClient.AtUrl("ReferenceData/AccountTypes/").Post<AccountType, AccountType>(data);
        }

        /// <summary>
        /// Update an existing account type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<AccountType>> Update(string id, AccountType data)
        {
             var urlTemplate = "ReferenceData/AccountTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<AccountType, AccountType>(data);
        }

        /// <summary>
        /// Delete an existing account type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/AccountTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class AccountTypesFacadeBatch
    {
        private IRestClient restClient;

        public AccountTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all account types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AccountTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/AccountTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AccountTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/AccountTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of an account type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AccountType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/AccountTypes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new account type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(AccountType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AccountType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/AccountTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing account type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, AccountType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AccountType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/AccountTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing account type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/AccountTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ActionTypesFacade
    {
        private IRestClient restClient;

        public ActionTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all action types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<ActionTypes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ActionTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ActionTypes>();
        }

        /// 
        public async Task<RestResponse<ActionTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ActionTypes/Summary").Get<ActionTypeSummaries>();
        }

        /// <summary>
        /// Get the details of an action type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ActionType>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/ActionTypes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ActionType>();
        }

        /// <summary>
        /// Create a new action type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<ActionType>> Create(ActionType data)
        {
            return await restClient.AtUrl("ReferenceData/ActionTypes/").Post<ActionType, ActionType>(data);
        }

        /// <summary>
        /// Update an existing action type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ActionType>> Update(string id, ActionType data)
        {
             var urlTemplate = "ReferenceData/ActionTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<ActionType, ActionType>(data);
        }

        /// <summary>
        /// Delete an existing action type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/ActionTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ActionTypesFacadeBatch
    {
        private IRestClient restClient;

        public ActionTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all action types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ActionTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ActionTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ActionTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ActionTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of an action type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ActionType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ActionTypes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new action type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(ActionType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ActionType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ActionTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing action type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, ActionType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ActionType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/ActionTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing action type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ActionTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ActivityCategoriesFacade
    {
        private IRestClient restClient;

        public ActivityCategoriesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all activity categories. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<ActivityCategories>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ActivityCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ActivityCategories>();
        }

        /// 
        public async Task<RestResponse<ActivityCategorySummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ActivityCategories/Summary").Get<ActivityCategorySummaries>();
        }

        /// <summary>
        /// Get the details of an activity category by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ActivityCategory>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/ActivityCategories/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ActivityCategory>();
        }

        /// <summary>
        /// Create a new activity category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<ActivityCategory>> Create(ActivityCategory data)
        {
            return await restClient.AtUrl("ReferenceData/ActivityCategories/").Post<ActivityCategory, ActivityCategory>(data);
        }

        /// <summary>
        /// Update an existing activity category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ActivityCategory>> Update(string id, ActivityCategory data)
        {
             var urlTemplate = "ReferenceData/ActivityCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<ActivityCategory, ActivityCategory>(data);
        }

        /// <summary>
        /// Delete an existing activity category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/ActivityCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ActivityCategoriesFacadeBatch
    {
        private IRestClient restClient;

        public ActivityCategoriesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all activity categories. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ActivityCategories";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ActivityCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ActivityCategorySummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ActivityCategories/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of an activity category by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ActivityCategory";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ActivityCategories/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new activity category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(ActivityCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ActivityCategory";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ActivityCategories/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing activity category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, ActivityCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ActivityCategory";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/ActivityCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing activity category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ActivityCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ActivityTypesFacade
    {
        private IRestClient restClient;

        public ActivityTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all activity types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<ActivityTypes>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ActivityTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ActivityTypes>();
        }

        /// 
        public async Task<RestResponse<ActivityTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ActivityTypes/Summary").Get<ActivityTypeSummaries>();
        }

        /// <summary>
        /// Get the details of an activity type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ActivityType>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/ActivityTypes/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ActivityType>();
        }

        /// <summary>
        /// Create a new activity type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<ActivityType>> Create(ActivityType data)
        {
            return await restClient.AtUrl("ReferenceData/ActivityTypes/").Post<ActivityType, ActivityType>(data);
        }

        /// <summary>
        /// Update an existing activity type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ActivityType>> Update(string id, ActivityType data)
        {
             var urlTemplate = "ReferenceData/ActivityTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<ActivityType, ActivityType>(data);
        }

        /// <summary>
        /// Delete an existing activity type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/ActivityTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ActivityTypesFacadeBatch
    {
        private IRestClient restClient;

        public ActivityTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all activity types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ActivityTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ActivityTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ActivityTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ActivityTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of an activity type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ActivityType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ActivityTypes/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new activity type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(ActivityType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ActivityType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ActivityTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing activity type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, ActivityType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ActivityType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/ActivityTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing activity type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ActivityTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class AddressTypesFacade
    {
        private IRestClient restClient;

        public AddressTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all address types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<AddressTypes>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/AddressTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<AddressTypes>();
        }

        /// 
        public async Task<RestResponse<AddressTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/AddressTypes/Summary").Get<AddressTypeSummaries>();
        }

        /// <summary>
        /// Get the details of an address type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<AddressType>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/AddressTypes/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<AddressType>();
        }

        /// <summary>
        /// Create a new address type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<AddressType>> Create(AddressType data)
        {
            return await restClient.AtUrl("ReferenceData/AddressTypes/").Post<AddressType, AddressType>(data);
        }

        /// <summary>
        /// Update an existing address type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<AddressType>> Update(string id, AddressType data)
        {
             var urlTemplate = "ReferenceData/AddressTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<AddressType, AddressType>(data);
        }

        /// <summary>
        /// Delete an existing address type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/AddressTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class AddressTypesFacadeBatch
    {
        private IRestClient restClient;

        public AddressTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all address types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AddressTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/AddressTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AddressTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/AddressTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of an address type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AddressType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/AddressTypes/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new address type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(AddressType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AddressType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/AddressTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing address type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, AddressType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AddressType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/AddressTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing address type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/AddressTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class AffiliationTypesFacade
    {
        private IRestClient restClient;

        public AffiliationTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<AffiliationTypes>> GetAll(string constituentTypeId = "null", string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/AffiliationTypes/?constituentTypeId={0}&filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, constituentTypeId,filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<AffiliationTypes>();
        }

        /// 
        public async Task<RestResponse<AffiliationTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/AffiliationTypes/Summary").Get<AffiliationTypeSummaries>();
        }

        /// <summary>
        /// Get the details of an affiliation type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<AffiliationType>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/AffiliationTypes/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<AffiliationType>();
        }

        /// <summary>
        /// Create a new affiliation type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<AffiliationType>> Create(AffiliationType data)
        {
            return await restClient.AtUrl("ReferenceData/AffiliationTypes/").Post<AffiliationType, AffiliationType>(data);
        }

        /// <summary>
        /// Update an existing affiliation type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<AffiliationType>> Update(string id, AffiliationType data)
        {
             var urlTemplate = "ReferenceData/AffiliationTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<AffiliationType, AffiliationType>(data);
        }

        /// <summary>
        /// Delete an existing affiliation type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/AffiliationTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class AffiliationTypesFacadeBatch
    {
        private IRestClient restClient;

        public AffiliationTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(string constituentTypeId = "null", string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AffiliationTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/AffiliationTypes/?constituentTypeId={0}&filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, constituentTypeId,filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AffiliationTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/AffiliationTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of an affiliation type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AffiliationType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/AffiliationTypes/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new affiliation type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(AffiliationType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AffiliationType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/AffiliationTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing affiliation type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, AffiliationType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AffiliationType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/AffiliationTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing affiliation type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/AffiliationTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class AliasTypesFacade
    {
        private IRestClient restClient;

        public AliasTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all alias types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<AliasTypes>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/AliasTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<AliasTypes>();
        }

        /// 
        public async Task<RestResponse<AliasTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/AliasTypes/Summary").Get<AliasTypeSummaries>();
        }

        /// <summary>
        /// Get the details of an alias type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<AliasType>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/AliasTypes/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<AliasType>();
        }

        /// <summary>
        /// Create a new alias type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<AliasType>> Create(AliasType data)
        {
            return await restClient.AtUrl("ReferenceData/AliasTypes/").Post<AliasType, AliasType>(data);
        }

        /// <summary>
        /// Update an existing alias type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<AliasType>> Update(string id, AliasType data)
        {
             var urlTemplate = "ReferenceData/AliasTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<AliasType, AliasType>(data);
        }

        /// <summary>
        /// Delete an existing alias type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/AliasTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class AliasTypesFacadeBatch
    {
        private IRestClient restClient;

        public AliasTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all alias types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AliasTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/AliasTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AliasTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/AliasTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of an alias type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AliasType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/AliasTypes/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new alias type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(AliasType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AliasType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/AliasTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing alias type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, AliasType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AliasType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/AliasTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing alias type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/AliasTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class AppealCategoriesFacade
    {
        private IRestClient restClient;

        public AppealCategoriesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all appeal categories. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<AppealCategories>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/AppealCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<AppealCategories>();
        }

        /// 
        public async Task<RestResponse<AppealCategorySummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/AppealCategories/Summary").Get<AppealCategorySummaries>();
        }

        /// <summary>
        /// Get the details of an appeal category by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<AppealCategory>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/AppealCategories/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<AppealCategory>();
        }

        /// <summary>
        /// Create a new appeal category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<AppealCategory>> Create(AppealCategory data)
        {
            return await restClient.AtUrl("ReferenceData/AppealCategories/").Post<AppealCategory, AppealCategory>(data);
        }

        /// <summary>
        /// Update an existing appeal category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<AppealCategory>> Update(string id, AppealCategory data)
        {
             var urlTemplate = "ReferenceData/AppealCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<AppealCategory, AppealCategory>(data);
        }

        /// <summary>
        /// Delete an existing appeal category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/AppealCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class AppealCategoriesFacadeBatch
    {
        private IRestClient restClient;

        public AppealCategoriesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all appeal categories. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AppealCategories";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/AppealCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AppealCategorySummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/AppealCategories/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of an appeal category by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AppealCategory";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/AppealCategories/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new appeal category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(AppealCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AppealCategory";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/AppealCategories/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing appeal category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, AppealCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AppealCategory";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/AppealCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing appeal category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/AppealCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class AssetTypesFacade
    {
        private IRestClient restClient;

        public AssetTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all asset types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<AssetTypes>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/AssetTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<AssetTypes>();
        }

        /// 
        public async Task<RestResponse<AssetTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/AssetTypes/Summary").Get<AssetTypeSummaries>();
        }

        /// <summary>
        /// Get the details of an asset type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<AssetType>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/AssetTypes/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<AssetType>();
        }

        /// <summary>
        /// Create a new asset type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<AssetType>> Create(AssetType data)
        {
            return await restClient.AtUrl("ReferenceData/AssetTypes/").Post<AssetType, AssetType>(data);
        }

        /// <summary>
        /// Update an existing asset type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<AssetType>> Update(string id, AssetType data)
        {
             var urlTemplate = "ReferenceData/AssetTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<AssetType, AssetType>(data);
        }

        /// <summary>
        /// Delete an existing asset type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/AssetTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class AssetTypesFacadeBatch
    {
        private IRestClient restClient;

        public AssetTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all asset types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AssetTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/AssetTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AssetTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/AssetTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of an asset type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AssetType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/AssetTypes/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new asset type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(AssetType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AssetType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/AssetTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing asset type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, AssetType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AssetType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/AssetTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing asset type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/AssetTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class AssociationTypesFacade
    {
        private IRestClient restClient;

        public AssociationTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all association types. To get only the resources for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<AssociationTypes>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/AssociationTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<AssociationTypes>();
        }

        /// 
        public async Task<RestResponse<AssociationTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/AssociationTypes/Summary").Get<AssociationTypeSummaries>();
        }

        /// <summary>
        /// Get the details of an association type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<AssociationType>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/AssociationTypes/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<AssociationType>();
        }

        /// <summary>
        /// Create a new association type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<AssociationType>> Create(AssociationType data)
        {
            return await restClient.AtUrl("ReferenceData/AssociationTypes/").Post<AssociationType, AssociationType>(data);
        }

        /// <summary>
        /// Update an existing association type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<AssociationType>> Update(string id, AssociationType data)
        {
             var urlTemplate = "ReferenceData/AssociationTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<AssociationType, AssociationType>(data);
        }

        /// <summary>
        /// Delete an existing association type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/AssociationTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class AssociationTypesFacadeBatch
    {
        private IRestClient restClient;

        public AssociationTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all association types. To get only the resources for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AssociationTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/AssociationTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AssociationTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/AssociationTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of an association type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AssociationType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/AssociationTypes/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new association type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(AssociationType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AssociationType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/AssociationTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing association type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, AssociationType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AssociationType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/AssociationTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing association type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/AssociationTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class BatchTypeGroupsFacade
    {
        private IRestClient restClient;

        public BatchTypeGroupsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all batch type groups. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<BatchTypeGroups>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/BatchTypeGroups/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<BatchTypeGroups>();
        }

        /// 
        public async Task<RestResponse<BatchTypeGroupSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/BatchTypeGroups/Summary").Get<BatchTypeGroupSummaries>();
        }

        /// <summary>
        /// Get the details of a batch type group by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<BatchTypeGroup>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/BatchTypeGroups/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<BatchTypeGroup>();
        }

        /// <summary>
        /// Create a new batch type group.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<BatchTypeGroup>> Create(BatchTypeGroup data)
        {
            return await restClient.AtUrl("ReferenceData/BatchTypeGroups/").Post<BatchTypeGroup, BatchTypeGroup>(data);
        }

        /// <summary>
        /// Update an existing batch type group.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<BatchTypeGroup>> Update(string id, BatchTypeGroup data)
        {
             var urlTemplate = "ReferenceData/BatchTypeGroups/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<BatchTypeGroup, BatchTypeGroup>(data);
        }

        /// <summary>
        /// Delete an existing batch type group.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/BatchTypeGroups/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class BatchTypeGroupsFacadeBatch
    {
        private IRestClient restClient;

        public BatchTypeGroupsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all batch type groups. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BatchTypeGroups";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/BatchTypeGroups/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BatchTypeGroupSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/BatchTypeGroups/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a batch type group by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BatchTypeGroup";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/BatchTypeGroups/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new batch type group.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(BatchTypeGroup data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BatchTypeGroup";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/BatchTypeGroups/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing batch type group.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, BatchTypeGroup data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BatchTypeGroup";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/BatchTypeGroups/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing batch type group.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/BatchTypeGroups/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class BatchTypesFacade
    {
        private IRestClient restClient;

        public BatchTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all batch types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<BatchTypes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/BatchTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<BatchTypes>();
        }

        /// 
        public async Task<RestResponse<BatchTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/BatchTypes/Summary").Get<BatchTypeSummaries>();
        }

        /// <summary>
        /// Get the details of a batch type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<BatchType>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/BatchTypes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<BatchType>();
        }

        /// <summary>
        /// Create a new batch type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<BatchType>> Create(BatchType data)
        {
            return await restClient.AtUrl("ReferenceData/BatchTypes/").Post<BatchType, BatchType>(data);
        }

        /// <summary>
        /// Update an existing batch type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<BatchType>> Update(string id, BatchType data)
        {
             var urlTemplate = "ReferenceData/BatchTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<BatchType, BatchType>(data);
        }

        /// <summary>
        /// Delete an existing batch type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/BatchTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class BatchTypesFacadeBatch
    {
        private IRestClient restClient;

        public BatchTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all batch types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BatchTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/BatchTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BatchTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/BatchTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a batch type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BatchType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/BatchTypes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new batch type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(BatchType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BatchType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/BatchTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing batch type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, BatchType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BatchType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/BatchTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing batch type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/BatchTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class BillingSchedulesFacade
    {
        private IRestClient restClient;

        public BillingSchedulesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<BillingSchedules>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/BillingSchedules/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<BillingSchedules>();
        }

        /// 
        public async Task<RestResponse<BillingScheduleSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/BillingSchedules/Summary").Get<BillingScheduleSummaries>();
        }

        /// 
        public async Task<RestResponse<BillingSchedule>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/BillingSchedules/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<BillingSchedule>();
        }

        /// 
        public async Task<RestResponse<BillingSchedule>> Create(BillingSchedule data)
        {
            return await restClient.AtUrl("ReferenceData/BillingSchedules/").Post<BillingSchedule, BillingSchedule>(data);
        }

        /// 
        public async Task<RestResponse<BillingSchedule>> Update(string id, BillingSchedule data)
        {
             var urlTemplate = "ReferenceData/BillingSchedules/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<BillingSchedule, BillingSchedule>(data);
        }

        /// 
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/BillingSchedules/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class BillingSchedulesFacadeBatch
    {
        private IRestClient restClient;

        public BillingSchedulesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BillingSchedules";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/BillingSchedules/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BillingScheduleSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/BillingSchedules/Summary";

            return bRequest;
        }

        /// 
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BillingSchedule";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/BillingSchedules/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Create(BillingSchedule data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BillingSchedule";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/BillingSchedules/";

            return bRequest;
        }

        /// 
        public Request Update(string id, BillingSchedule data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BillingSchedule";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/BillingSchedules/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/BillingSchedules/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class BillingTypesFacade
    {
        private IRestClient restClient;

        public BillingTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<BillingTypes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/BillingTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<BillingTypes>();
        }

        /// 
        public async Task<RestResponse<BillingTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/BillingTypes/Summary").Get<BillingTypeSummaries>();
        }

        /// 
        public async Task<RestResponse<BillingType>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/BillingTypes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<BillingType>();
        }

        /// 
        public async Task<RestResponse<BillingType>> Create(BillingType data)
        {
            return await restClient.AtUrl("ReferenceData/BillingTypes/").Post<BillingType, BillingType>(data);
        }

        /// 
        public async Task<RestResponse<BillingType>> Update(string id, BillingType data)
        {
             var urlTemplate = "ReferenceData/BillingTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<BillingType, BillingType>(data);
        }

        /// 
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/BillingTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class BillingTypesFacadeBatch
    {
        private IRestClient restClient;

        public BillingTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BillingTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/BillingTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BillingTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/BillingTypes/Summary";

            return bRequest;
        }

        /// 
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BillingType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/BillingTypes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Create(BillingType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BillingType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/BillingTypes/";

            return bRequest;
        }

        /// 
        public Request Update(string id, BillingType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BillingType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/BillingTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/BillingTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class BookingCategoriesFacade
    {
        private IRestClient restClient;

        public BookingCategoriesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<BookingCategories>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/BookingCategories/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<BookingCategories>();
        }

        /// 
        public async Task<RestResponse<BookingCategorySummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/BookingCategories/Summary").Get<BookingCategorySummaries>();
        }

        /// 
        public async Task<RestResponse<BookingCategory>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/BookingCategories/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<BookingCategory>();
        }

        /// 
        public async Task<RestResponse<BookingCategory>> Create(BookingCategory data)
        {
            return await restClient.AtUrl("ReferenceData/BookingCategories/").Post<BookingCategory, BookingCategory>(data);
        }

        /// 
        public async Task<RestResponse<BookingCategory>> Update(string id, BookingCategory data)
        {
             var urlTemplate = "ReferenceData/BookingCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<BookingCategory, BookingCategory>(data);
        }

        /// 
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/BookingCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class BookingCategoriesFacadeBatch
    {
        private IRestClient restClient;

        public BookingCategoriesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BookingCategories";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/BookingCategories/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BookingCategorySummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/BookingCategories/Summary";

            return bRequest;
        }

        /// 
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BookingCategory";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/BookingCategories/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Create(BookingCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BookingCategory";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/BookingCategories/";

            return bRequest;
        }

        /// 
        public Request Update(string id, BookingCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BookingCategory";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/BookingCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/BookingCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class BusinessUnitsFacade
    {
        private IRestClient restClient;

        public BusinessUnitsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all business units. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<BusinessUnits>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/BusinessUnits/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<BusinessUnits>();
        }

        /// 
        public async Task<RestResponse<BusinessUnitSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/BusinessUnits/Summary").Get<BusinessUnitSummaries>();
        }

        /// <summary>
        /// Get the details of a business unit by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<BusinessUnit>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/BusinessUnits/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<BusinessUnit>();
        }

        /// <summary>
        /// Create a new business unit.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<BusinessUnit>> Create(BusinessUnit data)
        {
            return await restClient.AtUrl("ReferenceData/BusinessUnits/").Post<BusinessUnit, BusinessUnit>(data);
        }

        /// <summary>
        /// Update an existing business unit.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<BusinessUnit>> Update(string id, BusinessUnit data)
        {
             var urlTemplate = "ReferenceData/BusinessUnits/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<BusinessUnit, BusinessUnit>(data);
        }

        /// <summary>
        /// Delete an existing business unit.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/BusinessUnits/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class BusinessUnitsFacadeBatch
    {
        private IRestClient restClient;

        public BusinessUnitsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all business units. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BusinessUnits";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/BusinessUnits/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BusinessUnitSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/BusinessUnits/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a business unit by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BusinessUnit";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/BusinessUnits/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new business unit.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(BusinessUnit data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BusinessUnit";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/BusinessUnits/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing business unit.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, BusinessUnit data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BusinessUnit";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/BusinessUnits/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing business unit.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/BusinessUnits/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class CardReaderTypesFacade
    {
        private IRestClient restClient;

        public CardReaderTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<CardReaderTypes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/CardReaderTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<CardReaderTypes>();
        }

        /// 
        public async Task<RestResponse<CardReaderTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/CardReaderTypes/Summary").Get<CardReaderTypeSummaries>();
        }

        /// 
        public async Task<RestResponse<CardReaderType>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/CardReaderTypes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<CardReaderType>();
        }

        /// 
        public async Task<RestResponse<CardReaderType>> Create(CardReaderType data)
        {
            return await restClient.AtUrl("ReferenceData/CardReaderTypes/").Post<CardReaderType, CardReaderType>(data);
        }

        /// 
        public async Task<RestResponse<CardReaderType>> Update(string id, CardReaderType data)
        {
             var urlTemplate = "ReferenceData/CardReaderTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<CardReaderType, CardReaderType>(data);
        }

        /// 
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/CardReaderTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class CardReaderTypesFacadeBatch
    {
        private IRestClient restClient;

        public CardReaderTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CardReaderTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/CardReaderTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CardReaderTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/CardReaderTypes/Summary";

            return bRequest;
        }

        /// 
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CardReaderType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/CardReaderTypes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Create(CardReaderType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CardReaderType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/CardReaderTypes/";

            return bRequest;
        }

        /// 
        public Request Update(string id, CardReaderType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CardReaderType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/CardReaderTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/CardReaderTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ColorsFacade
    {
        private IRestClient restClient;

        public ColorsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all colors. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<Colors>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/Colors/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Colors>();
        }

        /// 
        public async Task<RestResponse<ColorSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/Colors/Summary").Get<ColorSummaries>();
        }

        /// <summary>
        /// Get the details of a color by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Color>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/Colors/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Color>();
        }

        /// <summary>
        /// Create a new color.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<Color>> Create(Color data)
        {
            return await restClient.AtUrl("ReferenceData/Colors/").Post<Color, Color>(data);
        }

        /// <summary>
        /// Update an existing color.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Color>> Update(string id, Color data)
        {
             var urlTemplate = "ReferenceData/Colors/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<Color, Color>(data);
        }

        /// <summary>
        /// Delete an existing color.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/Colors/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ColorsFacadeBatch
    {
        private IRestClient restClient;

        public ColorsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all colors. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Colors";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Colors/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ColorSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Colors/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a color by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Color";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Colors/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new color.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(Color data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Color";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Colors/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing color.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, Color data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Color";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/Colors/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing color.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Colors/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ComposersFacade
    {
        private IRestClient restClient;

        public ComposersFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all composers. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<Composers>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/Composers/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Composers>();
        }

        /// 
        public async Task<RestResponse<ComposerSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/Composers/Summary").Get<ComposerSummaries>();
        }

        /// <summary>
        /// Get the details of a composer by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Composer>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/Composers/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Composer>();
        }

        /// <summary>
        /// Create a new composer.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<Composer>> Create(Composer data)
        {
            return await restClient.AtUrl("ReferenceData/Composers/").Post<Composer, Composer>(data);
        }

        /// <summary>
        /// Update an existing composer.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Composer>> Update(string id, Composer data)
        {
             var urlTemplate = "ReferenceData/Composers/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<Composer, Composer>(data);
        }

        /// <summary>
        /// Delete an existing composer.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/Composers/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ComposersFacadeBatch
    {
        private IRestClient restClient;

        public ComposersFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all composers. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Composers";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Composers/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ComposerSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Composers/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a composer by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Composer";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Composers/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new composer.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(Composer data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Composer";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Composers/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing composer.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, Composer data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Composer";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/Composers/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing composer.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Composers/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ConstituencyTypesFacade
    {
        private IRestClient restClient;

        public ConstituencyTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all constituency types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituencyTypes>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ConstituencyTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ConstituencyTypes>();
        }

        /// 
        public async Task<RestResponse<ConstituencyTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ConstituencyTypes/Summary").Get<ConstituencyTypeSummaries>();
        }

        /// <summary>
        /// Get the details of a constituency type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituencyType>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/ConstituencyTypes/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ConstituencyType>();
        }

        /// <summary>
        /// Create a new constituency type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituencyType>> Create(ConstituencyType data)
        {
            return await restClient.AtUrl("ReferenceData/ConstituencyTypes/").Post<ConstituencyType, ConstituencyType>(data);
        }

        /// <summary>
        /// Update an existing constituency type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituencyType>> Update(string id, ConstituencyType data)
        {
             var urlTemplate = "ReferenceData/ConstituencyTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<ConstituencyType, ConstituencyType>(data);
        }

        /// <summary>
        /// Delete an existing constituency type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/ConstituencyTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ConstituencyTypesFacadeBatch
    {
        private IRestClient restClient;

        public ConstituencyTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all constituency types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituencyTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ConstituencyTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituencyTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ConstituencyTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a constituency type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituencyType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ConstituencyTypes/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new constituency type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(ConstituencyType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituencyType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ConstituencyTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing constituency type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, ConstituencyType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituencyType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/ConstituencyTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing constituency type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ConstituencyTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ConstituentGroupsFacade
    {
        private IRestClient restClient;

        public ConstituentGroupsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all constituent groups. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentGroups>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ConstituentGroups/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ConstituentGroups>();
        }

        /// 
        public async Task<RestResponse<ConstituentGroupSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ConstituentGroups/Summary").Get<ConstituentGroupSummaries>();
        }

        /// <summary>
        /// Get the details of a constituent group by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentGroup>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/ConstituentGroups/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ConstituentGroup>();
        }

        /// <summary>
        /// Create a new constituent group.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentGroup>> Create(ConstituentGroup data)
        {
            return await restClient.AtUrl("ReferenceData/ConstituentGroups/").Post<ConstituentGroup, ConstituentGroup>(data);
        }

        /// <summary>
        /// Update an existing constituent group.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentGroup>> Update(string id, ConstituentGroup data)
        {
             var urlTemplate = "ReferenceData/ConstituentGroups/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<ConstituentGroup, ConstituentGroup>(data);
        }

        /// <summary>
        /// Delete an existing constituent group.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/ConstituentGroups/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ConstituentGroupsFacadeBatch
    {
        private IRestClient restClient;

        public ConstituentGroupsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all constituent groups. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentGroups";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ConstituentGroups/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentGroupSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ConstituentGroups/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a constituent group by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentGroup";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ConstituentGroups/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new constituent group.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(ConstituentGroup data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentGroup";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ConstituentGroups/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing constituent group.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, ConstituentGroup data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentGroup";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/ConstituentGroups/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing constituent group.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ConstituentGroups/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ConstituentInactivesFacade
    {
        private IRestClient restClient;

        public ConstituentInactivesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all constituent inactives. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentInactives>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ConstituentInactives/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ConstituentInactives>();
        }

        /// 
        public async Task<RestResponse<ConstituentInactiveSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ConstituentInactives/Summary").Get<ConstituentInactiveSummaries>();
        }

        /// <summary>
        /// Get the details of a constituent inactive by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentInactive>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/ConstituentInactives/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ConstituentInactive>();
        }

        /// <summary>
        /// Create a new constituent inactive.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentInactive>> Create(ConstituentInactive data)
        {
            return await restClient.AtUrl("ReferenceData/ConstituentInactives/").Post<ConstituentInactive, ConstituentInactive>(data);
        }

        /// <summary>
        /// Update an existing constituent inactive.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentInactive>> Update(string id, ConstituentInactive data)
        {
             var urlTemplate = "ReferenceData/ConstituentInactives/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<ConstituentInactive, ConstituentInactive>(data);
        }

        /// <summary>
        /// Delete an existing constituent inactive.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/ConstituentInactives/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ConstituentInactivesFacadeBatch
    {
        private IRestClient restClient;

        public ConstituentInactivesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all constituent inactives. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentInactives";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ConstituentInactives/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentInactiveSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ConstituentInactives/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a constituent inactive by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentInactive";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ConstituentInactives/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new constituent inactive.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(ConstituentInactive data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentInactive";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ConstituentInactives/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing constituent inactive.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, ConstituentInactive data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentInactive";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/ConstituentInactives/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing constituent inactive.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ConstituentInactives/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ConstituentTypeAffiliatesFacade
    {
        private IRestClient restClient;

        public ConstituentTypeAffiliatesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all constituent type affiliates. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentTypeAffiliates>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ConstituentTypeAffiliates/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ConstituentTypeAffiliates>();
        }

        /// 
        public async Task<RestResponse<ConstituentTypeAffiliateSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ConstituentTypeAffiliates/Summary").Get<ConstituentTypeAffiliateSummaries>();
        }

        /// <summary>
        /// Get the details of a constituent type affiliate by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentTypeAffiliate>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/ConstituentTypeAffiliates/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ConstituentTypeAffiliate>();
        }

        /// <summary>
        /// Create a new constituent type affiliate.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentTypeAffiliate>> Create(ConstituentTypeAffiliate data)
        {
            return await restClient.AtUrl("ReferenceData/ConstituentTypeAffiliates/").Post<ConstituentTypeAffiliate, ConstituentTypeAffiliate>(data);
        }

        /// <summary>
        /// Update an existing constituent type affiliate.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentTypeAffiliate>> Update(string id, ConstituentTypeAffiliate data)
        {
             var urlTemplate = "ReferenceData/ConstituentTypeAffiliates/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<ConstituentTypeAffiliate, ConstituentTypeAffiliate>(data);
        }

        /// <summary>
        /// Delete an existing constituent type affiliate.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/ConstituentTypeAffiliates/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ConstituentTypeAffiliatesFacadeBatch
    {
        private IRestClient restClient;

        public ConstituentTypeAffiliatesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all constituent type affiliates. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentTypeAffiliates";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ConstituentTypeAffiliates/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentTypeAffiliateSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ConstituentTypeAffiliates/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a constituent type affiliate by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentTypeAffiliate";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ConstituentTypeAffiliates/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new constituent type affiliate.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(ConstituentTypeAffiliate data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentTypeAffiliate";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ConstituentTypeAffiliates/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing constituent type affiliate.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, ConstituentTypeAffiliate data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentTypeAffiliate";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/ConstituentTypeAffiliates/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing constituent type affiliate.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ConstituentTypeAffiliates/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ConstituentTypesFacade
    {
        private IRestClient restClient;

        public ConstituentTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all constituent types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentTypes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ConstituentTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ConstituentTypes>();
        }

        /// 
        public async Task<RestResponse<ConstituentTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ConstituentTypes/Summary").Get<ConstituentTypeSummaries>();
        }

        /// <summary>
        /// Get the details of a constituent type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentType>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/ConstituentTypes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ConstituentType>();
        }

        /// <summary>
        /// Create a new constituent type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentType>> Create(ConstituentType data)
        {
            return await restClient.AtUrl("ReferenceData/ConstituentTypes/").Post<ConstituentType, ConstituentType>(data);
        }

        /// <summary>
        /// Update an existing constituent type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ConstituentType>> Update(string id, ConstituentType data)
        {
             var urlTemplate = "ReferenceData/ConstituentTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<ConstituentType, ConstituentType>(data);
        }

        /// <summary>
        /// Delete an existing constituent type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/ConstituentTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ConstituentTypesFacadeBatch
    {
        private IRestClient restClient;

        public ConstituentTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all constituent types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ConstituentTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ConstituentTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a constituent type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ConstituentTypes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new constituent type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(ConstituentType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ConstituentTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing constituent type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, ConstituentType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ConstituentType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/ConstituentTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing constituent type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ConstituentTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ContactPermissionCategoriesFacade
    {
        private IRestClient restClient;

        public ContactPermissionCategoriesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all contact permission categories.  To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPermissionCategories>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ContactPermissionCategories/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ContactPermissionCategories>();
        }

        /// 
        public async Task<RestResponse<ContactPermissionCategorySummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ContactPermissionCategories/Summary").Get<ContactPermissionCategorySummaries>();
        }

        /// <summary>
        /// Get the details of a contact permission category. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resource in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="id"></param>
        /// <param name="filter"></param>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPermissionCategory>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/ContactPermissionCategories/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ContactPermissionCategory>();
        }

        /// <summary>
        /// Create a new contact permission category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPermissionCategory>> Create(ContactPermissionCategory data)
        {
            return await restClient.AtUrl("ReferenceData/ContactPermissionCategories/").Post<ContactPermissionCategory, ContactPermissionCategory>(data);
        }

        /// <summary>
        /// Update an existing contact permission category.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPermissionCategory>> Update(string id, ContactPermissionCategory data)
        {
             var urlTemplate = "ReferenceData/ContactPermissionCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<ContactPermissionCategory, ContactPermissionCategory>(data);
        }

        /// <summary>
        /// Delete an existing contact permission category.
        /// </summary>
        /// <param name="id"></param>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/ContactPermissionCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ContactPermissionCategoriesFacadeBatch
    {
        private IRestClient restClient;

        public ContactPermissionCategoriesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all contact permission categories.  To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPermissionCategories";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ContactPermissionCategories/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPermissionCategorySummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ContactPermissionCategories/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a contact permission category. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resource in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="id"></param>
        /// <param name="filter"></param>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPermissionCategory";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ContactPermissionCategories/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new contact permission category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(ContactPermissionCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPermissionCategory";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ContactPermissionCategories/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing contact permission category.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Update(string id, ContactPermissionCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPermissionCategory";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/ContactPermissionCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing contact permission category.
        /// </summary>
        /// <param name="id"></param>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ContactPermissionCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ContactPermissionTypesFacade
    {
        private IRestClient restClient;

        public ContactPermissionTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all contact permission types. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPermissionTypes>> GetAll(string filter = "ReadWrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ContactPermissionTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ContactPermissionTypes>();
        }

        /// 
        public async Task<RestResponse<ContactPermissionTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ContactPermissionTypes/Summary").Get<ContactPermissionTypeSummaries>();
        }

        /// <summary>
        /// Get the details of a contact permission type. To get the resource only if the user has write/edit access, pass filter="writeonly".  To get the resource in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="id"></param>
        /// <param name="filter"></param>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPermissionType>> Get(string id, string filter = "ReadWrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/ContactPermissionTypes/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ContactPermissionType>();
        }

        /// <summary>
        /// Create a new contact permission type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPermissionType>> Create(ContactPermissionType data)
        {
            return await restClient.AtUrl("ReferenceData/ContactPermissionTypes/").Post<ContactPermissionType, ContactPermissionType>(data);
        }

        /// <summary>
        /// Update an existing contact permission type.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPermissionType>> Update(string id, ContactPermissionType data)
        {
             var urlTemplate = "ReferenceData/ContactPermissionTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<ContactPermissionType, ContactPermissionType>(data);
        }

        /// <summary>
        /// Delete an existing contact permission type.
        /// </summary>
        /// <param name="id"></param>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/ContactPermissionTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ContactPermissionTypesFacadeBatch
    {
        private IRestClient restClient;

        public ContactPermissionTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all contact permission types. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "ReadWrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPermissionTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ContactPermissionTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPermissionTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ContactPermissionTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a contact permission type. To get the resource only if the user has write/edit access, pass filter="writeonly".  To get the resource in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="id"></param>
        /// <param name="filter"></param>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "ReadWrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPermissionType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ContactPermissionTypes/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new contact permission type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(ContactPermissionType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPermissionType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ContactPermissionTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing contact permission type.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Update(string id, ContactPermissionType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPermissionType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/ContactPermissionTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing contact permission type.
        /// </summary>
        /// <param name="id"></param>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ContactPermissionTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ContactPointCategoriesFacade
    {
        private IRestClient restClient;

        public ContactPointCategoriesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all contact point categories. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPointCategories>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ContactPointCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ContactPointCategories>();
        }

        /// 
        public async Task<RestResponse<ContactPointCategorySummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ContactPointCategories/Summary").Get<ContactPointCategorySummaries>();
        }

        /// <summary>
        /// Get the details of a contact point category by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPointCategory>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/ContactPointCategories/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ContactPointCategory>();
        }

        /// <summary>
        /// Create a new contact point category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPointCategory>> Create(ContactPointCategory data)
        {
            return await restClient.AtUrl("ReferenceData/ContactPointCategories/").Post<ContactPointCategory, ContactPointCategory>(data);
        }

        /// <summary>
        /// Update an existing contact point category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPointCategory>> Update(string id, ContactPointCategory data)
        {
             var urlTemplate = "ReferenceData/ContactPointCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<ContactPointCategory, ContactPointCategory>(data);
        }

        /// <summary>
        /// Delete an existing contact point category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/ContactPointCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ContactPointCategoriesFacadeBatch
    {
        private IRestClient restClient;

        public ContactPointCategoriesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all contact point categories. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPointCategories";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ContactPointCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPointCategorySummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ContactPointCategories/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a contact point category by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPointCategory";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ContactPointCategories/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new contact point category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(ContactPointCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPointCategory";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ContactPointCategories/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing contact point category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, ContactPointCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPointCategory";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/ContactPointCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing contact point category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ContactPointCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ContactPointCategoryPurposesFacade
    {
        private IRestClient restClient;

        public ContactPointCategoryPurposesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all contact point category purposes. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPointCategoryPurposes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ContactPointCategoryPurposes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ContactPointCategoryPurposes>();
        }

        /// 
        public async Task<RestResponse<ContactPointCategoryPurposeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ContactPointCategoryPurposes/Summary").Get<ContactPointCategoryPurposeSummaries>();
        }

        /// <summary>
        /// Get the details of a contact point category purpos by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPointCategoryPurpose>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/ContactPointCategoryPurposes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ContactPointCategoryPurpose>();
        }

        /// <summary>
        /// Create a new contact point category purpos.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPointCategoryPurpose>> Create(ContactPointCategoryPurpose data)
        {
            return await restClient.AtUrl("ReferenceData/ContactPointCategoryPurposes/").Post<ContactPointCategoryPurpose, ContactPointCategoryPurpose>(data);
        }

        /// <summary>
        /// Update an existing contact point category purpos.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPointCategoryPurpose>> Update(string id, ContactPointCategoryPurpose data)
        {
             var urlTemplate = "ReferenceData/ContactPointCategoryPurposes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<ContactPointCategoryPurpose, ContactPointCategoryPurpose>(data);
        }

        /// <summary>
        /// Delete an existing contact point category purpos.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/ContactPointCategoryPurposes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ContactPointCategoryPurposesFacadeBatch
    {
        private IRestClient restClient;

        public ContactPointCategoryPurposesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all contact point category purposes. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPointCategoryPurposes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ContactPointCategoryPurposes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPointCategoryPurposeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ContactPointCategoryPurposes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a contact point category purpos by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPointCategoryPurpose";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ContactPointCategoryPurposes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new contact point category purpos.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(ContactPointCategoryPurpose data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPointCategoryPurpose";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ContactPointCategoryPurposes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing contact point category purpos.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, ContactPointCategoryPurpose data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPointCategoryPurpose";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/ContactPointCategoryPurposes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing contact point category purpos.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ContactPointCategoryPurposes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ContactPointPurposeCategoriesFacade
    {
        private IRestClient restClient;

        public ContactPointPurposeCategoriesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all contact point purpose categories. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<PurposeCategories>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ContactPointPurposeCategories/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PurposeCategories>();
        }

        /// 
        public async Task<RestResponse<PurposeCategorySummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ContactPointPurposeCategories/Summary").Get<PurposeCategorySummaries>();
        }

        /// <summary>
        /// Get the details of a contact point purpose category by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PurposeCategory>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/ContactPointPurposeCategories/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PurposeCategory>();
        }

        /// <summary>
        /// Create a new contact point purpose category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<PurposeCategory>> Create(PurposeCategory data)
        {
            return await restClient.AtUrl("ReferenceData/ContactPointPurposeCategories/").Post<PurposeCategory, PurposeCategory>(data);
        }

        /// <summary>
        /// Update an existing contact point purpose category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PurposeCategory>> Update(string id, PurposeCategory data)
        {
             var urlTemplate = "ReferenceData/ContactPointPurposeCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<PurposeCategory, PurposeCategory>(data);
        }

        /// <summary>
        /// Delete an existing contact point purpose category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/ContactPointPurposeCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ContactPointPurposeCategoriesFacadeBatch
    {
        private IRestClient restClient;

        public ContactPointPurposeCategoriesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all contact point purpose categories. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PurposeCategories";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ContactPointPurposeCategories/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PurposeCategorySummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ContactPointPurposeCategories/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a contact point purpose category by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PurposeCategory";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ContactPointPurposeCategories/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new contact point purpose category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(PurposeCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PurposeCategory";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ContactPointPurposeCategories/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing contact point purpose category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, PurposeCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PurposeCategory";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/ContactPointPurposeCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing contact point purpose category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ContactPointPurposeCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ContactPointPurposesFacade
    {
        private IRestClient restClient;

        public ContactPointPurposesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all contact point purposes. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPointPurposes>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ContactPointPurposes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ContactPointPurposes>();
        }

        /// 
        public async Task<RestResponse<ContactPointPurposeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ContactPointPurposes/Summary").Get<ContactPointPurposeSummaries>();
        }

        /// <summary>
        /// Get the details of a contact point purpos by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPointPurpose>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/ContactPointPurposes/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ContactPointPurpose>();
        }

        /// <summary>
        /// Create a new contact point purpos.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPointPurpose>> Create(ContactPointPurpose data)
        {
            return await restClient.AtUrl("ReferenceData/ContactPointPurposes/").Post<ContactPointPurpose, ContactPointPurpose>(data);
        }

        /// <summary>
        /// Update an existing contact point purpos.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactPointPurpose>> Update(string id, ContactPointPurpose data)
        {
             var urlTemplate = "ReferenceData/ContactPointPurposes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<ContactPointPurpose, ContactPointPurpose>(data);
        }

        /// <summary>
        /// Delete an existing contact point purpos.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/ContactPointPurposes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ContactPointPurposesFacadeBatch
    {
        private IRestClient restClient;

        public ContactPointPurposesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all contact point purposes. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPointPurposes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ContactPointPurposes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPointPurposeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ContactPointPurposes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a contact point purpos by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPointPurpose";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ContactPointPurposes/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new contact point purpos.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(ContactPointPurpose data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPointPurpose";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ContactPointPurposes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing contact point purpos.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, ContactPointPurpose data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactPointPurpose";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/ContactPointPurposes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing contact point purpos.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ContactPointPurposes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ContactTypesFacade
    {
        private IRestClient restClient;

        public ContactTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all contact types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactTypes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ContactTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ContactTypes>();
        }

        /// 
        public async Task<RestResponse<ContactTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ContactTypes/Summary").Get<ContactTypeSummaries>();
        }

        /// <summary>
        /// Get the details of a contact type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactType>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/ContactTypes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ContactType>();
        }

        /// <summary>
        /// Create a new contact type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactType>> Create(ContactType data)
        {
            return await restClient.AtUrl("ReferenceData/ContactTypes/").Post<ContactType, ContactType>(data);
        }

        /// <summary>
        /// Update an existing contact type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContactType>> Update(string id, ContactType data)
        {
             var urlTemplate = "ReferenceData/ContactTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<ContactType, ContactType>(data);
        }

        /// <summary>
        /// Delete an existing contact type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/ContactTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ContactTypesFacadeBatch
    {
        private IRestClient restClient;

        public ContactTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all contact types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ContactTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ContactTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a contact type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ContactTypes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new contact type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(ContactType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ContactTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing contact type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, ContactType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContactType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/ContactTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing contact type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ContactTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ContributionDesignationsFacade
    {
        private IRestClient restClient;

        public ContributionDesignationsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all contribution designations. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContributionDesignations>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ContributionDesignations/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ContributionDesignations>();
        }

        /// 
        public async Task<RestResponse<ContributionDesignationSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ContributionDesignations/Summary").Get<ContributionDesignationSummaries>();
        }

        /// <summary>
        /// Get the details of a contribution designation by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContributionDesignation>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/ContributionDesignations/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ContributionDesignation>();
        }

        /// <summary>
        /// Create a new contribution designation.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContributionDesignation>> Create(ContributionDesignation data)
        {
            return await restClient.AtUrl("ReferenceData/ContributionDesignations/").Post<ContributionDesignation, ContributionDesignation>(data);
        }

        /// <summary>
        /// Update an existing contribution designation.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ContributionDesignation>> Update(string id, ContributionDesignation data)
        {
             var urlTemplate = "ReferenceData/ContributionDesignations/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<ContributionDesignation, ContributionDesignation>(data);
        }

        /// <summary>
        /// Delete an existing contribution designation.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/ContributionDesignations/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ContributionDesignationsFacadeBatch
    {
        private IRestClient restClient;

        public ContributionDesignationsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all contribution designations. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContributionDesignations";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ContributionDesignations/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContributionDesignationSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ContributionDesignations/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a contribution designation by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContributionDesignation";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ContributionDesignations/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new contribution designation.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(ContributionDesignation data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContributionDesignation";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ContributionDesignations/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing contribution designation.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, ContributionDesignation data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContributionDesignation";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/ContributionDesignations/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing contribution designation.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ContributionDesignations/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ControlGroupsFacade
    {
        private IRestClient restClient;

        public ControlGroupsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all control groups. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<ControlGroups>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ControlGroups/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ControlGroups>();
        }

        /// 
        public async Task<RestResponse<ControlGroupSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ControlGroups/Summary").Get<ControlGroupSummaries>();
        }

        /// <summary>
        /// Get the details of a control group by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ControlGroup>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/ControlGroups/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ControlGroup>();
        }

        /// <summary>
        /// Create a new control group.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<ControlGroup>> Create(ControlGroup data)
        {
            return await restClient.AtUrl("ReferenceData/ControlGroups/").Post<ControlGroup, ControlGroup>(data);
        }

        /// <summary>
        /// Update an existing control group.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ControlGroup>> Update(string id, ControlGroup data)
        {
             var urlTemplate = "ReferenceData/ControlGroups/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<ControlGroup, ControlGroup>(data);
        }

        /// <summary>
        /// Delete an existing control group.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/ControlGroups/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ControlGroupsFacadeBatch
    {
        private IRestClient restClient;

        public ControlGroupsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all control groups. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ControlGroups";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ControlGroups/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ControlGroupSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ControlGroups/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a control group by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ControlGroup";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ControlGroups/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new control group.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(ControlGroup data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ControlGroup";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ControlGroups/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing control group.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, ControlGroup data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ControlGroup";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/ControlGroups/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing control group.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ControlGroups/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class CountriesFacade
    {
        private IRestClient restClient;

        public CountriesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all countries. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<Countries>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/Countries/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Countries>();
        }

        /// 
        public async Task<RestResponse<CountrySummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/Countries/Summary").Get<CountrySummaries>();
        }

        /// <summary>
        /// Get the details of a country by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Country>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/Countries/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Country>();
        }

        /// <summary>
        /// Create a new country.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<Country>> Create(Country data)
        {
            return await restClient.AtUrl("ReferenceData/Countries/").Post<Country, Country>(data);
        }

        /// <summary>
        /// Update an existing country.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Country>> Update(string id, Country data)
        {
             var urlTemplate = "ReferenceData/Countries/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<Country, Country>(data);
        }

        /// <summary>
        /// Delete an existing country.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/Countries/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class CountriesFacadeBatch
    {
        private IRestClient restClient;

        public CountriesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all countries. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Countries";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Countries/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CountrySummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Countries/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a country by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Country";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Countries/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new country.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(Country data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Country";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Countries/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing country.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, Country data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Country";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/Countries/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing country.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Countries/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class CriterionOperatorsFacade
    {
        private IRestClient restClient;

        public CriterionOperatorsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all criterion operators. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<CriterionOperators>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/CriterionOperators/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<CriterionOperators>();
        }

        /// 
        public async Task<RestResponse<CriterionOperatorSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/CriterionOperators/Summary").Get<CriterionOperatorSummaries>();
        }

        /// <summary>
        /// Get the details of a criterion operator by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<CriterionOperator>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/CriterionOperators/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<CriterionOperator>();
        }

    }
 

 
    /// 
    public class CriterionOperatorsFacadeBatch
    {
        private IRestClient restClient;

        public CriterionOperatorsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all criterion operators. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CriterionOperators";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/CriterionOperators/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CriterionOperatorSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/CriterionOperators/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a criterion operator by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CriterionOperator";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/CriterionOperators/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class CurrencyTypesFacade
    {
        private IRestClient restClient;

        public CurrencyTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<CurrencyTypes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/CurrencyTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<CurrencyTypes>();
        }

        /// 
        public async Task<RestResponse<CurrencyTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/CurrencyTypes/Summary").Get<CurrencyTypeSummaries>();
        }

        /// 
        public async Task<RestResponse<CurrencyType>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/CurrencyTypes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<CurrencyType>();
        }

        /// 
        public async Task<RestResponse<CurrencyType>> Create(CurrencyType data)
        {
            return await restClient.AtUrl("ReferenceData/CurrencyTypes/").Post<CurrencyType, CurrencyType>(data);
        }

        /// 
        public async Task<RestResponse<CurrencyType>> Update(string id, CurrencyType data)
        {
             var urlTemplate = "ReferenceData/CurrencyTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<CurrencyType, CurrencyType>(data);
        }

        /// 
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/CurrencyTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class CurrencyTypesFacadeBatch
    {
        private IRestClient restClient;

        public CurrencyTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CurrencyTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/CurrencyTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CurrencyTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/CurrencyTypes/Summary";

            return bRequest;
        }

        /// 
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CurrencyType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/CurrencyTypes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Create(CurrencyType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CurrencyType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/CurrencyTypes/";

            return bRequest;
        }

        /// 
        public Request Update(string id, CurrencyType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CurrencyType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/CurrencyTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/CurrencyTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class DeliveryMethodsFacade
    {
        private IRestClient restClient;

        public DeliveryMethodsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all delivery methods. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<DeliveryMethods>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/DeliveryMethods/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<DeliveryMethods>();
        }

        /// 
        public async Task<RestResponse<DeliveryMethodSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/DeliveryMethods/Summary").Get<DeliveryMethodSummaries>();
        }

        /// <summary>
        /// Get the details of a delivery method by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<DeliveryMethod>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/DeliveryMethods/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<DeliveryMethod>();
        }

        /// <summary>
        /// Create a new delivery method.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<DeliveryMethod>> Create(DeliveryMethod data)
        {
            return await restClient.AtUrl("ReferenceData/DeliveryMethods/").Post<DeliveryMethod, DeliveryMethod>(data);
        }

        /// <summary>
        /// Update an existing delivery method.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<DeliveryMethod>> Update(string id, DeliveryMethod data)
        {
             var urlTemplate = "ReferenceData/DeliveryMethods/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<DeliveryMethod, DeliveryMethod>(data);
        }

        /// <summary>
        /// Delete an existing delivery method.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/DeliveryMethods/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class DeliveryMethodsFacadeBatch
    {
        private IRestClient restClient;

        public DeliveryMethodsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all delivery methods. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DeliveryMethods";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/DeliveryMethods/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DeliveryMethodSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/DeliveryMethods/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a delivery method by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DeliveryMethod";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/DeliveryMethods/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new delivery method.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(DeliveryMethod data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DeliveryMethod";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/DeliveryMethods/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing delivery method.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, DeliveryMethod data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DeliveryMethod";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/DeliveryMethods/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing delivery method.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/DeliveryMethods/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class DesignationCodesFacade
    {
        private IRestClient restClient;

        public DesignationCodesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all designation codes. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<DesignationCodes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/DesignationCodes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<DesignationCodes>();
        }

        /// 
        public async Task<RestResponse<DesignationCodeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/DesignationCodes/Summary").Get<DesignationCodeSummaries>();
        }

        /// <summary>
        /// Get the details of a designation code by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<DesignationCode>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/DesignationCodes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<DesignationCode>();
        }

        /// <summary>
        /// Create a new designation code.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<DesignationCode>> Create(DesignationCode data)
        {
            return await restClient.AtUrl("ReferenceData/DesignationCodes/").Post<DesignationCode, DesignationCode>(data);
        }

        /// <summary>
        /// Update an existing designation code.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<DesignationCode>> Update(string id, DesignationCode data)
        {
             var urlTemplate = "ReferenceData/DesignationCodes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<DesignationCode, DesignationCode>(data);
        }

        /// <summary>
        /// Delete an existing designation code.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/DesignationCodes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class DesignationCodesFacadeBatch
    {
        private IRestClient restClient;

        public DesignationCodesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all designation codes. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DesignationCodes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/DesignationCodes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DesignationCodeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/DesignationCodes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a designation code by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DesignationCode";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/DesignationCodes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new designation code.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(DesignationCode data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DesignationCode";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/DesignationCodes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing designation code.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, DesignationCode data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DesignationCode";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/DesignationCodes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing designation code.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/DesignationCodes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class DesignsFacade
    {
        private IRestClient restClient;

        public DesignsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all designs. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<Designs>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/Designs/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Designs>();
        }

        /// 
        public async Task<RestResponse<DesignSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/Designs/Summary").Get<DesignSummaries>();
        }

        /// <summary>
        /// Get the details of a design by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Design>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/Designs/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Design>();
        }

    }
 

 
    /// 
    public class DesignsFacadeBatch
    {
        private IRestClient restClient;

        public DesignsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all designs. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Designs";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Designs/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DesignSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Designs/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a design by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Design";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Designs/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class DiscountTypesFacade
    {
        private IRestClient restClient;

        public DiscountTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all discount types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<DiscountTypes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/DiscountTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<DiscountTypes>();
        }

        /// 
        public async Task<RestResponse<DiscountTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/DiscountTypes/Summary").Get<DiscountTypeSummaries>();
        }

        /// <summary>
        /// Get the details of a discount type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<DiscountType>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/DiscountTypes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<DiscountType>();
        }

        /// <summary>
        /// Create a new discount type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<DiscountType>> Create(DiscountType data)
        {
            return await restClient.AtUrl("ReferenceData/DiscountTypes/").Post<DiscountType, DiscountType>(data);
        }

        /// <summary>
        /// Update an existing discount type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<DiscountType>> Update(string id, DiscountType data)
        {
             var urlTemplate = "ReferenceData/DiscountTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<DiscountType, DiscountType>(data);
        }

        /// <summary>
        /// Delete an existing discount type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/DiscountTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class DiscountTypesFacadeBatch
    {
        private IRestClient restClient;

        public DiscountTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all discount types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DiscountTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/DiscountTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DiscountTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/DiscountTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a discount type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DiscountType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/DiscountTypes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new discount type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(DiscountType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DiscountType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/DiscountTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing discount type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, DiscountType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DiscountType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/DiscountTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing discount type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/DiscountTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class DonationLevelsFacade
    {
        private IRestClient restClient;

        public DonationLevelsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all donation levels. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<DonationLevels>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/DonationLevels/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<DonationLevels>();
        }

        /// 
        public async Task<RestResponse<DonationLevelSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/DonationLevels/Summary").Get<DonationLevelSummaries>();
        }

        /// <summary>
        /// Get the details of a donation level by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<DonationLevel>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/DonationLevels/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<DonationLevel>();
        }

        /// <summary>
        /// Create a new donation level.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<DonationLevel>> Create(DonationLevel data)
        {
            return await restClient.AtUrl("ReferenceData/DonationLevels/").Post<DonationLevel, DonationLevel>(data);
        }

        /// <summary>
        /// Update an existing donation level.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<DonationLevel>> Update(string id, DonationLevel data)
        {
             var urlTemplate = "ReferenceData/DonationLevels/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<DonationLevel, DonationLevel>(data);
        }

        /// <summary>
        /// Delete an existing donation level.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/DonationLevels/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class DonationLevelsFacadeBatch
    {
        private IRestClient restClient;

        public DonationLevelsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all donation levels. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DonationLevels";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/DonationLevels/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DonationLevelSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/DonationLevels/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a donation level by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DonationLevel";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/DonationLevels/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new donation level.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(DonationLevel data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DonationLevel";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/DonationLevels/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing donation level.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, DonationLevel data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DonationLevel";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/DonationLevels/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing donation level.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/DonationLevels/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ElectronicAddressTypesFacade
    {
        private IRestClient restClient;

        public ElectronicAddressTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all electronic address types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<ElectronicAddressTypes>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ElectronicAddressTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ElectronicAddressTypes>();
        }

        /// 
        public async Task<RestResponse<ElectronicAddressTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ElectronicAddressTypes/Summary").Get<ElectronicAddressTypeSummaries>();
        }

        /// <summary>
        /// Get the details of an electronic address type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ElectronicAddressType>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/ElectronicAddressTypes/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ElectronicAddressType>();
        }

        /// <summary>
        /// Create a new electronic address type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<ElectronicAddressType>> Create(ElectronicAddressType data)
        {
            return await restClient.AtUrl("ReferenceData/ElectronicAddressTypes/").Post<ElectronicAddressType, ElectronicAddressType>(data);
        }

        /// <summary>
        /// Update an existing electronic address type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ElectronicAddressType>> Update(string id, ElectronicAddressType data)
        {
             var urlTemplate = "ReferenceData/ElectronicAddressTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<ElectronicAddressType, ElectronicAddressType>(data);
        }

        /// <summary>
        /// Delete an existing electronic address type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/ElectronicAddressTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ElectronicAddressTypesFacadeBatch
    {
        private IRestClient restClient;

        public ElectronicAddressTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all electronic address types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ElectronicAddressTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ElectronicAddressTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ElectronicAddressTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ElectronicAddressTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of an electronic address type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ElectronicAddressType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ElectronicAddressTypes/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new electronic address type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(ElectronicAddressType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ElectronicAddressType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ElectronicAddressTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing electronic address type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, ElectronicAddressType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ElectronicAddressType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/ElectronicAddressTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing electronic address type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ElectronicAddressTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class EmailProfilesFacade
    {
        private IRestClient restClient;

        public EmailProfilesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all email profiles
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<EmailProfiles>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/EmailProfiles/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<EmailProfiles>();
        }

        /// 
        public async Task<RestResponse<EmailProfileSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/EmailProfiles/Summary").Get<EmailProfileSummaries>();
        }

        /// <summary>
        /// Get the details of an email profile by id
        /// </summary>
        /// <param name="id"></param>
        /// <param name="filter"></param>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<EmailProfile>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/EmailProfiles/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<EmailProfile>();
        }

        /// <summary>
        /// Create a new email profile
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<EmailProfile>> Create(EmailProfile data)
        {
            return await restClient.AtUrl("ReferenceData/EmailProfiles/").Post<EmailProfile, EmailProfile>(data);
        }

        /// <summary>
        /// Update an existing email profile
        /// </summary>
        /// <param name="id"></param>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<EmailProfile>> Update(string id, EmailProfile data)
        {
             var urlTemplate = "ReferenceData/EmailProfiles/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<EmailProfile, EmailProfile>(data);
        }

        /// <summary>
        /// Delete an existing email profile
        /// </summary>
        /// <param name="id"></param>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/EmailProfiles/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class EmailProfilesFacadeBatch
    {
        private IRestClient restClient;

        public EmailProfilesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all email profiles
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.EmailProfiles";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/EmailProfiles/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.EmailProfileSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/EmailProfiles/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of an email profile by id
        /// </summary>
        /// <param name="id"></param>
        /// <param name="filter"></param>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.EmailProfile";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/EmailProfiles/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new email profile
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(EmailProfile data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.EmailProfile";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/EmailProfiles/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing email profile
        /// </summary>
        /// <param name="id"></param>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Update(string id, EmailProfile data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.EmailProfile";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/EmailProfiles/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing email profile
        /// </summary>
        /// <param name="id"></param>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/EmailProfiles/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class EmarketIndicatorsFacade
    {
        private IRestClient restClient;

        public EmarketIndicatorsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all emarket indicators. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<EmarketIndicators>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/EmarketIndicators/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<EmarketIndicators>();
        }

        /// 
        public async Task<RestResponse<EmarketIndicatorSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/EmarketIndicators/Summary").Get<EmarketIndicatorSummaries>();
        }

        /// <summary>
        /// Get the details of an emarket indicator by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<EmarketIndicator>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/EmarketIndicators/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<EmarketIndicator>();
        }

        /// <summary>
        /// Create a new emarket indicator.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<EmarketIndicator>> Create(EmarketIndicator data)
        {
            return await restClient.AtUrl("ReferenceData/EmarketIndicators/").Post<EmarketIndicator, EmarketIndicator>(data);
        }

        /// <summary>
        /// Update an existing emarket indicator.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<EmarketIndicator>> Update(string id, EmarketIndicator data)
        {
             var urlTemplate = "ReferenceData/EmarketIndicators/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<EmarketIndicator, EmarketIndicator>(data);
        }

        /// <summary>
        /// Delete an existing emarket indicator.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/EmarketIndicators/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class EmarketIndicatorsFacadeBatch
    {
        private IRestClient restClient;

        public EmarketIndicatorsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all emarket indicators. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.EmarketIndicators";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/EmarketIndicators/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.EmarketIndicatorSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/EmarketIndicators/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of an emarket indicator by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.EmarketIndicator";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/EmarketIndicators/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new emarket indicator.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(EmarketIndicator data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.EmarketIndicator";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/EmarketIndicators/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing emarket indicator.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, EmarketIndicator data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.EmarketIndicator";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/EmarketIndicators/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing emarket indicator.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/EmarketIndicators/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ErasFacade
    {
        private IRestClient restClient;

        public ErasFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all eras. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<Eras>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/Eras/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Eras>();
        }

        /// 
        public async Task<RestResponse<EraSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/Eras/Summary").Get<EraSummaries>();
        }

        /// <summary>
        /// Get the details of an era by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Era>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/Eras/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Era>();
        }

        /// <summary>
        /// Create a new era.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<Era>> Create(Era data)
        {
            return await restClient.AtUrl("ReferenceData/Eras/").Post<Era, Era>(data);
        }

        /// <summary>
        /// Update an existing era.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Era>> Update(string id, Era data)
        {
             var urlTemplate = "ReferenceData/Eras/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<Era, Era>(data);
        }

        /// <summary>
        /// Delete an existing era.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/Eras/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ErasFacadeBatch
    {
        private IRestClient restClient;

        public ErasFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all eras. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Eras";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Eras/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.EraSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Eras/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of an era by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Era";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Eras/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new era.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(Era data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Era";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Eras/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing era.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, Era data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Era";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/Eras/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing era.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Eras/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class FormatsFacade
    {
        private IRestClient restClient;

        public FormatsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all formats. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<Formats>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/Formats/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Formats>();
        }

        /// 
        public async Task<RestResponse<FormatSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/Formats/Summary").Get<FormatSummaries>();
        }

        /// <summary>
        /// Get the details of a format by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Format>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/Formats/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Format>();
        }

    }
 

 
    /// 
    public class FormatsFacadeBatch
    {
        private IRestClient restClient;

        public FormatsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all formats. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Formats";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Formats/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.FormatSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Formats/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a format by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Format";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Formats/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class GiftAidContactMethodsFacade
    {
        private IRestClient restClient;

        public GiftAidContactMethodsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all gift aid contact methods. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftAidContactMethods>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/GiftAidContactMethods/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<GiftAidContactMethods>();
        }

        /// 
        public async Task<RestResponse<GiftAidContactMethodSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/GiftAidContactMethods/Summary").Get<GiftAidContactMethodSummaries>();
        }

        /// <summary>
        /// Get the details of a gift aid contact method by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftAidContactMethod>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/GiftAidContactMethods/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<GiftAidContactMethod>();
        }

        /// <summary>
        /// Create a new gift aid contact method.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftAidContactMethod>> Create(GiftAidContactMethod data)
        {
            return await restClient.AtUrl("ReferenceData/GiftAidContactMethods/").Post<GiftAidContactMethod, GiftAidContactMethod>(data);
        }

        /// <summary>
        /// Update an existing gift aid contact method.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftAidContactMethod>> Update(string id, GiftAidContactMethod data)
        {
             var urlTemplate = "ReferenceData/GiftAidContactMethods/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<GiftAidContactMethod, GiftAidContactMethod>(data);
        }

        /// <summary>
        /// Delete an existing gift aid contact method.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/GiftAidContactMethods/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class GiftAidContactMethodsFacadeBatch
    {
        private IRestClient restClient;

        public GiftAidContactMethodsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all gift aid contact methods. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidContactMethods";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/GiftAidContactMethods/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidContactMethodSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/GiftAidContactMethods/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a gift aid contact method by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidContactMethod";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/GiftAidContactMethods/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new gift aid contact method.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(GiftAidContactMethod data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidContactMethod";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/GiftAidContactMethods/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing gift aid contact method.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, GiftAidContactMethod data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidContactMethod";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/GiftAidContactMethods/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing gift aid contact method.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/GiftAidContactMethods/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class GiftAidDocumentStatusesFacade
    {
        private IRestClient restClient;

        public GiftAidDocumentStatusesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all gift aid document statuses. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftAidDocumentStatuses>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/GiftAidDocumentStatuses/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<GiftAidDocumentStatuses>();
        }

        /// 
        public async Task<RestResponse<GiftAidDocumentStatusSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/GiftAidDocumentStatuses/Summary").Get<GiftAidDocumentStatusSummaries>();
        }

        /// <summary>
        /// Get the details of a gift aid document status by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftAidDocumentStatus>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/GiftAidDocumentStatuses/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<GiftAidDocumentStatus>();
        }

        /// <summary>
        /// Create a new gift aid document status.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftAidDocumentStatus>> Create(GiftAidDocumentStatus data)
        {
            return await restClient.AtUrl("ReferenceData/GiftAidDocumentStatuses/").Post<GiftAidDocumentStatus, GiftAidDocumentStatus>(data);
        }

        /// <summary>
        /// Update an existing gift aid document status.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftAidDocumentStatus>> Update(string id, GiftAidDocumentStatus data)
        {
             var urlTemplate = "ReferenceData/GiftAidDocumentStatuses/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<GiftAidDocumentStatus, GiftAidDocumentStatus>(data);
        }

        /// <summary>
        /// Delete an existing gift aid document status.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/GiftAidDocumentStatuses/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class GiftAidDocumentStatusesFacadeBatch
    {
        private IRestClient restClient;

        public GiftAidDocumentStatusesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all gift aid document statuses. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidDocumentStatuses";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/GiftAidDocumentStatuses/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidDocumentStatusSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/GiftAidDocumentStatuses/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a gift aid document status by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidDocumentStatus";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/GiftAidDocumentStatuses/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new gift aid document status.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(GiftAidDocumentStatus data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidDocumentStatus";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/GiftAidDocumentStatuses/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing gift aid document status.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, GiftAidDocumentStatus data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidDocumentStatus";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/GiftAidDocumentStatuses/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing gift aid document status.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/GiftAidDocumentStatuses/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class GiftAidIneligibleReasonsFacade
    {
        private IRestClient restClient;

        public GiftAidIneligibleReasonsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all gift aid ineligible reasons. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftAidIneligibleReasons>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/GiftAidIneligibleReasons/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<GiftAidIneligibleReasons>();
        }

        /// 
        public async Task<RestResponse<GiftAidIneligibleReasonSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/GiftAidIneligibleReasons/Summary").Get<GiftAidIneligibleReasonSummaries>();
        }

        /// <summary>
        /// Get the details of a gift aid ineligible reason by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftAidIneligibleReason>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/GiftAidIneligibleReasons/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<GiftAidIneligibleReason>();
        }

        /// <summary>
        /// Create a new gift aid ineligible reason.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftAidIneligibleReason>> Create(GiftAidIneligibleReason data)
        {
            return await restClient.AtUrl("ReferenceData/GiftAidIneligibleReasons/").Post<GiftAidIneligibleReason, GiftAidIneligibleReason>(data);
        }

        /// <summary>
        /// Update an existing gift aid ineligible reason.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftAidIneligibleReason>> Update(string id, GiftAidIneligibleReason data)
        {
             var urlTemplate = "ReferenceData/GiftAidIneligibleReasons/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<GiftAidIneligibleReason, GiftAidIneligibleReason>(data);
        }

        /// <summary>
        /// Delete an existing gift aid ineligible reason.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/GiftAidIneligibleReasons/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class GiftAidIneligibleReasonsFacadeBatch
    {
        private IRestClient restClient;

        public GiftAidIneligibleReasonsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all gift aid ineligible reasons. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidIneligibleReasons";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/GiftAidIneligibleReasons/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidIneligibleReasonSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/GiftAidIneligibleReasons/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a gift aid ineligible reason by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidIneligibleReason";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/GiftAidIneligibleReasons/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new gift aid ineligible reason.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(GiftAidIneligibleReason data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidIneligibleReason";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/GiftAidIneligibleReasons/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing gift aid ineligible reason.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, GiftAidIneligibleReason data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidIneligibleReason";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/GiftAidIneligibleReasons/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing gift aid ineligible reason.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/GiftAidIneligibleReasons/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class GiftAidRatesFacade
    {
        private IRestClient restClient;

        public GiftAidRatesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all gift aid rates. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftAidRates>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/GiftAidRates/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<GiftAidRates>();
        }

        /// 
        public async Task<RestResponse<GiftAidRateSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/GiftAidRates/Summary").Get<GiftAidRateSummaries>();
        }

        /// <summary>
        /// Get the details of a gift aid rate by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftAidRate>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/GiftAidRates/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<GiftAidRate>();
        }

        /// <summary>
        /// Create a new gift aid rate.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftAidRate>> Create(GiftAidRate data)
        {
            return await restClient.AtUrl("ReferenceData/GiftAidRates/").Post<GiftAidRate, GiftAidRate>(data);
        }

        /// <summary>
        /// Update an existing gift aid rate.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftAidRate>> Update(string id, GiftAidRate data)
        {
             var urlTemplate = "ReferenceData/GiftAidRates/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<GiftAidRate, GiftAidRate>(data);
        }

        /// <summary>
        /// Delete an existing gift aid rate.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/GiftAidRates/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class GiftAidRatesFacadeBatch
    {
        private IRestClient restClient;

        public GiftAidRatesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all gift aid rates. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidRates";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/GiftAidRates/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidRateSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/GiftAidRates/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a gift aid rate by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidRate";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/GiftAidRates/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new gift aid rate.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(GiftAidRate data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidRate";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/GiftAidRates/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing gift aid rate.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, GiftAidRate data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidRate";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/GiftAidRates/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing gift aid rate.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/GiftAidRates/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class GiftAidStatusesFacade
    {
        private IRestClient restClient;

        public GiftAidStatusesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all gift aid statuses. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftAidStatuses>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/GiftAidStatuses/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<GiftAidStatuses>();
        }

        /// 
        public async Task<RestResponse<GiftAidStatusSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/GiftAidStatuses/Summary").Get<GiftAidStatusSummaries>();
        }

        /// <summary>
        /// Get the details of a gift aid status by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftAidStatus>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/GiftAidStatuses/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<GiftAidStatus>();
        }

        /// <summary>
        /// Create a new gift aid status.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftAidStatus>> Create(GiftAidStatus data)
        {
            return await restClient.AtUrl("ReferenceData/GiftAidStatuses/").Post<GiftAidStatus, GiftAidStatus>(data);
        }

        /// <summary>
        /// Update an existing gift aid status.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftAidStatus>> Update(string id, GiftAidStatus data)
        {
             var urlTemplate = "ReferenceData/GiftAidStatuses/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<GiftAidStatus, GiftAidStatus>(data);
        }

        /// <summary>
        /// Delete an existing gift aid status.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/GiftAidStatuses/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class GiftAidStatusesFacadeBatch
    {
        private IRestClient restClient;

        public GiftAidStatusesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all gift aid statuses. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidStatuses";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/GiftAidStatuses/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidStatusSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/GiftAidStatuses/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a gift aid status by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidStatus";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/GiftAidStatuses/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new gift aid status.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(GiftAidStatus data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidStatus";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/GiftAidStatuses/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing gift aid status.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, GiftAidStatus data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidStatus";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/GiftAidStatuses/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing gift aid status.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/GiftAidStatuses/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class GiftAidTypesFacade
    {
        private IRestClient restClient;

        public GiftAidTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all gift aid types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftAidTypes>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/GiftAidTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<GiftAidTypes>();
        }

        /// 
        public async Task<RestResponse<GiftAidTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/GiftAidTypes/Summary").Get<GiftAidTypeSummaries>();
        }

        /// <summary>
        /// Get the details of a gift aid type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftAidType>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/GiftAidTypes/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<GiftAidType>();
        }

        /// <summary>
        /// Create a new gift aid type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftAidType>> Create(GiftAidType data)
        {
            return await restClient.AtUrl("ReferenceData/GiftAidTypes/").Post<GiftAidType, GiftAidType>(data);
        }

        /// <summary>
        /// Update an existing gift aid type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<GiftAidType>> Update(string id, GiftAidType data)
        {
             var urlTemplate = "ReferenceData/GiftAidTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<GiftAidType, GiftAidType>(data);
        }

        /// <summary>
        /// Delete an existing gift aid type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/GiftAidTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class GiftAidTypesFacadeBatch
    {
        private IRestClient restClient;

        public GiftAidTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all gift aid types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/GiftAidTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/GiftAidTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a gift aid type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/GiftAidTypes/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new gift aid type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(GiftAidType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/GiftAidTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing gift aid type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, GiftAidType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GiftAidType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/GiftAidTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing gift aid type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/GiftAidTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class GLAccountsFacade
    {
        private IRestClient restClient;

        public GLAccountsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all gl accounts. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<GlAccounts>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/GLAccounts/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<GlAccounts>();
        }

        /// 
        public async Task<RestResponse<GlAccountSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/GLAccounts/Summary").Get<GlAccountSummaries>();
        }

        /// <summary>
        /// Get the details of a gl account by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<GlAccount>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/GLAccounts/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<GlAccount>();
        }

    }
 

 
    /// 
    public class GLAccountsFacadeBatch
    {
        private IRestClient restClient;

        public GLAccountsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all gl accounts. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GlAccounts";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/GLAccounts/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GlAccountSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/GLAccounts/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a gl account by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.GlAccount";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/GLAccounts/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class HoldCodeCategoriesFacade
    {
        private IRestClient restClient;

        public HoldCodeCategoriesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<HoldCodeCategories>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/HoldCodeCategories/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<HoldCodeCategories>();
        }

        /// 
        public async Task<RestResponse<HoldCodeCategorySummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/HoldCodeCategories/Summary").Get<HoldCodeCategorySummaries>();
        }

        /// 
        public async Task<RestResponse<HoldCodeCategory>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/HoldCodeCategories/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<HoldCodeCategory>();
        }

        /// 
        public async Task<RestResponse<HoldCodeCategory>> Create(HoldCodeCategory data)
        {
            return await restClient.AtUrl("ReferenceData/HoldCodeCategories/").Post<HoldCodeCategory, HoldCodeCategory>(data);
        }

        /// 
        public async Task<RestResponse<HoldCodeCategory>> Update(string id, HoldCodeCategory data)
        {
             var urlTemplate = "ReferenceData/HoldCodeCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<HoldCodeCategory, HoldCodeCategory>(data);
        }

        /// 
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/HoldCodeCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class HoldCodeCategoriesFacadeBatch
    {
        private IRestClient restClient;

        public HoldCodeCategoriesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.HoldCodeCategories";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/HoldCodeCategories/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.HoldCodeCategorySummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/HoldCodeCategories/Summary";

            return bRequest;
        }

        /// 
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.HoldCodeCategory";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/HoldCodeCategories/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Create(HoldCodeCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.HoldCodeCategory";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/HoldCodeCategories/";

            return bRequest;
        }

        /// 
        public Request Update(string id, HoldCodeCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.HoldCodeCategory";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/HoldCodeCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/HoldCodeCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class InactiveReasonsFacade
    {
        private IRestClient restClient;

        public InactiveReasonsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all inactive reasons. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<InactiveReasons>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/InactiveReasons/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<InactiveReasons>();
        }

        /// 
        public async Task<RestResponse<InactiveReasonSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/InactiveReasons/Summary").Get<InactiveReasonSummaries>();
        }

        /// <summary>
        /// Get the details of an inactive reason by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<InactiveReason>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/InactiveReasons/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<InactiveReason>();
        }

        /// <summary>
        /// Create a new inactive reason.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<InactiveReason>> Create(InactiveReason data)
        {
            return await restClient.AtUrl("ReferenceData/InactiveReasons/").Post<InactiveReason, InactiveReason>(data);
        }

        /// <summary>
        /// Update an existing inactive reason.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<InactiveReason>> Update(string id, InactiveReason data)
        {
             var urlTemplate = "ReferenceData/InactiveReasons/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<InactiveReason, InactiveReason>(data);
        }

        /// <summary>
        /// Delete an existing inactive reason.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/InactiveReasons/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class InactiveReasonsFacadeBatch
    {
        private IRestClient restClient;

        public InactiveReasonsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all inactive reasons. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.InactiveReasons";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/InactiveReasons/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.InactiveReasonSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/InactiveReasons/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of an inactive reason by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.InactiveReason";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/InactiveReasons/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new inactive reason.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(InactiveReason data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.InactiveReason";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/InactiveReasons/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing inactive reason.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, InactiveReason data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.InactiveReason";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/InactiveReasons/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing inactive reason.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/InactiveReasons/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class InterestCategoriesFacade
    {
        private IRestClient restClient;

        public InterestCategoriesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all interest categories. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<InterestCategories>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/InterestCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<InterestCategories>();
        }

        /// 
        public async Task<RestResponse<InterestCategorySummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/InterestCategories/Summary").Get<InterestCategorySummaries>();
        }

        /// <summary>
        /// Get the details of an interest category by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<InterestCategory>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/InterestCategories/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<InterestCategory>();
        }

        /// <summary>
        /// Create a new interest category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<InterestCategory>> Create(InterestCategory data)
        {
            return await restClient.AtUrl("ReferenceData/InterestCategories/").Post<InterestCategory, InterestCategory>(data);
        }

        /// <summary>
        /// Update an existing interest category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<InterestCategory>> Update(string id, InterestCategory data)
        {
             var urlTemplate = "ReferenceData/InterestCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<InterestCategory, InterestCategory>(data);
        }

        /// <summary>
        /// Delete an existing interest category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/InterestCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class InterestCategoriesFacadeBatch
    {
        private IRestClient restClient;

        public InterestCategoriesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all interest categories. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.InterestCategories";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/InterestCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.InterestCategorySummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/InterestCategories/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of an interest category by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.InterestCategory";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/InterestCategories/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new interest category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(InterestCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.InterestCategory";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/InterestCategories/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing interest category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, InterestCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.InterestCategory";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/InterestCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing interest category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/InterestCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class InterestTypesFacade
    {
        private IRestClient restClient;

        public InterestTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all interest types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<InterestTypes>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/InterestTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<InterestTypes>();
        }

        /// 
        public async Task<RestResponse<InterestTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/InterestTypes/Summary").Get<InterestTypeSummaries>();
        }

        /// <summary>
        /// Get the details of an interest type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<InterestType>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/InterestTypes/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<InterestType>();
        }

        /// <summary>
        /// Create a new interest type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<InterestType>> Create(InterestType data)
        {
            return await restClient.AtUrl("ReferenceData/InterestTypes/").Post<InterestType, InterestType>(data);
        }

        /// <summary>
        /// Update an existing interest type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<InterestType>> Update(string id, InterestType data)
        {
             var urlTemplate = "ReferenceData/InterestTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<InterestType, InterestType>(data);
        }

        /// <summary>
        /// Delete an existing interest type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/InterestTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class InterestTypesFacadeBatch
    {
        private IRestClient restClient;

        public InterestTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all interest types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.InterestTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/InterestTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.InterestTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/InterestTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of an interest type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.InterestType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/InterestTypes/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new interest type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(InterestType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.InterestType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/InterestTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing interest type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, InterestType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.InterestType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/InterestTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing interest type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/InterestTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class KeywordCategoriesFacade
    {
        private IRestClient restClient;

        public KeywordCategoriesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all keyword categories. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<KeywordCategories>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/KeywordCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<KeywordCategories>();
        }

        /// 
        public async Task<RestResponse<KeywordCategorySummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/KeywordCategories/Summary").Get<KeywordCategorySummaries>();
        }

        /// <summary>
        /// Get the details of a keyword category by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<KeywordCategory>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/KeywordCategories/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<KeywordCategory>();
        }

        /// <summary>
        /// Create a new keyword category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<KeywordCategory>> Create(KeywordCategory data)
        {
            return await restClient.AtUrl("ReferenceData/KeywordCategories/").Post<KeywordCategory, KeywordCategory>(data);
        }

        /// <summary>
        /// Update an existing keyword category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<KeywordCategory>> Update(string id, KeywordCategory data)
        {
             var urlTemplate = "ReferenceData/KeywordCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<KeywordCategory, KeywordCategory>(data);
        }

        /// <summary>
        /// Delete an existing keyword category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/KeywordCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class KeywordCategoriesFacadeBatch
    {
        private IRestClient restClient;

        public KeywordCategoriesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all keyword categories. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.KeywordCategories";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/KeywordCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.KeywordCategorySummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/KeywordCategories/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a keyword category by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.KeywordCategory";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/KeywordCategories/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new keyword category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(KeywordCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.KeywordCategory";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/KeywordCategories/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing keyword category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, KeywordCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.KeywordCategory";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/KeywordCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing keyword category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/KeywordCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class KeywordsFacade
    {
        private IRestClient restClient;

        public KeywordsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all keywords. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<Keywords>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/Keywords/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Keywords>();
        }

        /// 
        public async Task<RestResponse<KeywordSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/Keywords/Summary").Get<KeywordSummaries>();
        }

        /// <summary>
        /// Get the details of a keyword by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Keyword>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/Keywords/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Keyword>();
        }

        /// <summary>
        /// Create a new keyword.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<Keyword>> Create(Keyword data)
        {
            return await restClient.AtUrl("ReferenceData/Keywords/").Post<Keyword, Keyword>(data);
        }

        /// <summary>
        /// Update an existing keyword.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Keyword>> Update(string id, Keyword data)
        {
             var urlTemplate = "ReferenceData/Keywords/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<Keyword, Keyword>(data);
        }

        /// <summary>
        /// Delete an existing keyword.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/Keywords/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// 
        public async Task<RestResponse<KeywordDataItems>> GetDataFor(string keywordId)
        {
            var urlTemplate = "ReferenceData/Keywords/Data/?keywordId={0}";
            urlTemplate = string.Format(urlTemplate, keywordId);
            return await restClient.AtUrl(urlTemplate).Get<KeywordDataItems>();
        }

    }
 

 
    /// 
    public class KeywordsFacadeBatch
    {
        private IRestClient restClient;

        public KeywordsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all keywords. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Keywords";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Keywords/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.KeywordSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Keywords/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a keyword by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Keyword";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Keywords/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new keyword.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(Keyword data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Keyword";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Keywords/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing keyword.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, Keyword data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Keyword";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/Keywords/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing keyword.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Keywords/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetDataFor(string keywordId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.KeywordDataItems";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Keywords/Data/?keywordId={0}";
            urlTemplate = string.Format(urlTemplate, keywordId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class LanguagesFacade
    {
        private IRestClient restClient;

        public LanguagesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all languages. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<Languages>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/Languages/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Languages>();
        }

        /// 
        public async Task<RestResponse<LanguageSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/Languages/Summary").Get<LanguageSummaries>();
        }

        /// <summary>
        /// Get the details of a language by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Language>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/Languages/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Language>();
        }

        /// <summary>
        /// Create a new language.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<Language>> Create(Language data)
        {
            return await restClient.AtUrl("ReferenceData/Languages/").Post<Language, Language>(data);
        }

        /// <summary>
        /// Update an existing language.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Language>> Update(string id, Language data)
        {
             var urlTemplate = "ReferenceData/Languages/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<Language, Language>(data);
        }

        /// <summary>
        /// Delete an existing language.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/Languages/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class LanguagesFacadeBatch
    {
        private IRestClient restClient;

        public LanguagesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all languages. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Languages";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Languages/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.LanguageSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Languages/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a language by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Language";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Languages/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new language.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(Language data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Language";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Languages/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing language.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, Language data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Language";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/Languages/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing language.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Languages/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ListCategoriesFacade
    {
        private IRestClient restClient;

        public ListCategoriesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all list categories. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<ListCategories>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ListCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ListCategories>();
        }

        /// 
        public async Task<RestResponse<ListCategorySummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ListCategories/Summary").Get<ListCategorySummaries>();
        }

        /// <summary>
        /// Get the details of a list category by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ListCategory>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/ListCategories/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ListCategory>();
        }

        /// <summary>
        /// Create a new list category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<ListCategory>> Create(ListCategory data)
        {
            return await restClient.AtUrl("ReferenceData/ListCategories/").Post<ListCategory, ListCategory>(data);
        }

        /// <summary>
        /// Update an existing list category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ListCategory>> Update(string id, ListCategory data)
        {
             var urlTemplate = "ReferenceData/ListCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<ListCategory, ListCategory>(data);
        }

        /// <summary>
        /// Delete an existing list category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/ListCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ListCategoriesFacadeBatch
    {
        private IRestClient restClient;

        public ListCategoriesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all list categories. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ListCategories";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ListCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ListCategorySummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ListCategories/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a list category by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ListCategory";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ListCategories/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new list category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(ListCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ListCategory";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ListCategories/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing list category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, ListCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ListCategory";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/ListCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing list category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ListCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class LoginTypesFacade
    {
        private IRestClient restClient;

        public LoginTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all login types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<LoginTypes>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/LoginTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<LoginTypes>();
        }

        /// 
        public async Task<RestResponse<LoginTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/LoginTypes/Summary").Get<LoginTypeSummaries>();
        }

        /// <summary>
        /// Get the details of a login type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<LoginType>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/LoginTypes/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<LoginType>();
        }

        /// <summary>
        /// Create a new login type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<LoginType>> Create(LoginType data)
        {
            return await restClient.AtUrl("ReferenceData/LoginTypes/").Post<LoginType, LoginType>(data);
        }

        /// <summary>
        /// Update an existing login type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<LoginType>> Update(string id, LoginType data)
        {
             var urlTemplate = "ReferenceData/LoginTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<LoginType, LoginType>(data);
        }

        /// <summary>
        /// Delete an existing login type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/LoginTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class LoginTypesFacadeBatch
    {
        private IRestClient restClient;

        public LoginTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all login types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.LoginTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/LoginTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.LoginTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/LoginTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a login type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.LoginType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/LoginTypes/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new login type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(LoginType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.LoginType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/LoginTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing login type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, LoginType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.LoginType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/LoginTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing login type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/LoginTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class MachineSettingsFacade
    {
        private IRestClient restClient;

        public MachineSettingsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<MachineSettings>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/MachineSettings/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<MachineSettings>();
        }

        /// 
        public async Task<RestResponse<MachineSettingSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/MachineSettings/Summary").Get<MachineSettingSummaries>();
        }

        /// 
        public async Task<RestResponse<MachineSetting>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/MachineSettings/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<MachineSetting>();
        }

        /// 
        public async Task<RestResponse<MachineSetting>> Create(MachineSetting data)
        {
            return await restClient.AtUrl("ReferenceData/MachineSettings/").Post<MachineSetting, MachineSetting>(data);
        }

        /// 
        public async Task<RestResponse<MachineSetting>> Update(string id, MachineSetting data)
        {
             var urlTemplate = "ReferenceData/MachineSettings/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<MachineSetting, MachineSetting>(data);
        }

        /// 
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/MachineSettings/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class MachineSettingsFacadeBatch
    {
        private IRestClient restClient;

        public MachineSettingsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MachineSettings";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/MachineSettings/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MachineSettingSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/MachineSettings/Summary";

            return bRequest;
        }

        /// 
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MachineSetting";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/MachineSettings/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Create(MachineSetting data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MachineSetting";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/MachineSettings/";

            return bRequest;
        }

        /// 
        public Request Update(string id, MachineSetting data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MachineSetting";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/MachineSettings/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/MachineSettings/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class MailIndicatorsFacade
    {
        private IRestClient restClient;

        public MailIndicatorsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all mail indicators. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<MailIndicators>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/MailIndicators/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<MailIndicators>();
        }

        /// 
        public async Task<RestResponse<MailIndicatorSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/MailIndicators/Summary").Get<MailIndicatorSummaries>();
        }

        /// <summary>
        /// Get the details of a mail indicator by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<MailIndicator>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/MailIndicators/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<MailIndicator>();
        }

        /// <summary>
        /// Create a new mail indicator.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<MailIndicator>> Create(MailIndicator data)
        {
            return await restClient.AtUrl("ReferenceData/MailIndicators/").Post<MailIndicator, MailIndicator>(data);
        }

        /// <summary>
        /// Update an existing mail indicator.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<MailIndicator>> Update(string id, MailIndicator data)
        {
             var urlTemplate = "ReferenceData/MailIndicators/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<MailIndicator, MailIndicator>(data);
        }

        /// <summary>
        /// Delete an existing mail indicator.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/MailIndicators/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class MailIndicatorsFacadeBatch
    {
        private IRestClient restClient;

        public MailIndicatorsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all mail indicators. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MailIndicators";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/MailIndicators/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MailIndicatorSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/MailIndicators/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a mail indicator by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MailIndicator";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/MailIndicators/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new mail indicator.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(MailIndicator data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MailIndicator";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/MailIndicators/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing mail indicator.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, MailIndicator data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MailIndicator";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/MailIndicators/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing mail indicator.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/MailIndicators/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class MediaTypesFacade
    {
        private IRestClient restClient;

        public MediaTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all media types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<MediaTypes>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/MediaTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<MediaTypes>();
        }

        /// 
        public async Task<RestResponse<MediaTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/MediaTypes/Summary").Get<MediaTypeSummaries>();
        }

        /// <summary>
        /// Get the details of a media type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<MediaType>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/MediaTypes/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<MediaType>();
        }

        /// <summary>
        /// Create a new media type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<MediaType>> Create(MediaType data)
        {
            return await restClient.AtUrl("ReferenceData/MediaTypes/").Post<MediaType, MediaType>(data);
        }

        /// <summary>
        /// Update an existing media type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<MediaType>> Update(string id, MediaType data)
        {
             var urlTemplate = "ReferenceData/MediaTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<MediaType, MediaType>(data);
        }

        /// <summary>
        /// Delete an existing media type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/MediaTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class MediaTypesFacadeBatch
    {
        private IRestClient restClient;

        public MediaTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all media types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MediaTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/MediaTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MediaTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/MediaTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a media type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MediaType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/MediaTypes/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new media type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(MediaType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MediaType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/MediaTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing media type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, MediaType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MediaType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/MediaTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing media type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/MediaTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class MembershipLevelCategoriesFacade
    {
        private IRestClient restClient;

        public MembershipLevelCategoriesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all membership level categories. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<MembershipLevelCategories>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/MembershipLevelCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<MembershipLevelCategories>();
        }

        /// 
        public async Task<RestResponse<MembershipLevelCategorySummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/MembershipLevelCategories/Summary").Get<MembershipLevelCategorySummaries>();
        }

        /// <summary>
        /// Get the details of a membership level category by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<MembershipLevelCategory>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/MembershipLevelCategories/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<MembershipLevelCategory>();
        }

        /// <summary>
        /// Create a new membership level category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<MembershipLevelCategory>> Create(MembershipLevelCategory data)
        {
            return await restClient.AtUrl("ReferenceData/MembershipLevelCategories/").Post<MembershipLevelCategory, MembershipLevelCategory>(data);
        }

        /// <summary>
        /// Update an existing membership level category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<MembershipLevelCategory>> Update(string id, MembershipLevelCategory data)
        {
             var urlTemplate = "ReferenceData/MembershipLevelCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<MembershipLevelCategory, MembershipLevelCategory>(data);
        }

        /// <summary>
        /// Delete an existing membership level category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/MembershipLevelCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class MembershipLevelCategoriesFacadeBatch
    {
        private IRestClient restClient;

        public MembershipLevelCategoriesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all membership level categories. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MembershipLevelCategories";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/MembershipLevelCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MembershipLevelCategorySummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/MembershipLevelCategories/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a membership level category by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MembershipLevelCategory";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/MembershipLevelCategories/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new membership level category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(MembershipLevelCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MembershipLevelCategory";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/MembershipLevelCategories/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing membership level category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, MembershipLevelCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.MembershipLevelCategory";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/MembershipLevelCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing membership level category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/MembershipLevelCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class NameStatusesFacade
    {
        private IRestClient restClient;

        public NameStatusesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all name statuses. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<NameStatuses>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/NameStatuses/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<NameStatuses>();
        }

        /// 
        public async Task<RestResponse<NameStatusSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/NameStatuses/Summary").Get<NameStatusSummaries>();
        }

        /// <summary>
        /// Get the details of a name status by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NameStatus>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/NameStatuses/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<NameStatus>();
        }

        /// <summary>
        /// Create a new name status.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<NameStatus>> Create(NameStatus data)
        {
            return await restClient.AtUrl("ReferenceData/NameStatuses/").Post<NameStatus, NameStatus>(data);
        }

        /// <summary>
        /// Update an existing name status.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NameStatus>> Update(string id, NameStatus data)
        {
             var urlTemplate = "ReferenceData/NameStatuses/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<NameStatus, NameStatus>(data);
        }

        /// <summary>
        /// Delete an existing name status.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/NameStatuses/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class NameStatusesFacadeBatch
    {
        private IRestClient restClient;

        public NameStatusesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all name statuses. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NameStatuses";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/NameStatuses/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NameStatusSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/NameStatuses/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a name status by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NameStatus";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/NameStatuses/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new name status.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(NameStatus data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NameStatus";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/NameStatuses/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing name status.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, NameStatus data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NameStatus";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/NameStatuses/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing name status.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/NameStatuses/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class NScanAccessAreasFacade
    {
        private IRestClient restClient;

        public NScanAccessAreasFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<NScanAccessAreas>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/NScanAccessAreas/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<NScanAccessAreas>();
        }

        /// 
        public async Task<RestResponse<NScanAccessAreaSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/NScanAccessAreas/Summary").Get<NScanAccessAreaSummaries>();
        }

        /// 
        public async Task<RestResponse<NScanAccessArea>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/NScanAccessAreas/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<NScanAccessArea>();
        }

        /// 
        public async Task<RestResponse<NScanAccessArea>> Create(NScanAccessArea data)
        {
            return await restClient.AtUrl("ReferenceData/NScanAccessAreas/").Post<NScanAccessArea, NScanAccessArea>(data);
        }

        /// 
        public async Task<RestResponse<NScanAccessArea>> Update(string id, NScanAccessArea data)
        {
             var urlTemplate = "ReferenceData/NScanAccessAreas/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<NScanAccessArea, NScanAccessArea>(data);
        }

        /// 
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/NScanAccessAreas/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class NScanAccessAreasFacadeBatch
    {
        private IRestClient restClient;

        public NScanAccessAreasFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NScanAccessAreas";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/NScanAccessAreas/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NScanAccessAreaSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/NScanAccessAreas/Summary";

            return bRequest;
        }

        /// 
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NScanAccessArea";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/NScanAccessAreas/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Create(NScanAccessArea data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NScanAccessArea";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/NScanAccessAreas/";

            return bRequest;
        }

        /// 
        public Request Update(string id, NScanAccessArea data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NScanAccessArea";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/NScanAccessAreas/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/NScanAccessAreas/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class OrderCategoriesFacade
    {
        private IRestClient restClient;

        public OrderCategoriesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all order categories. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<OrderCategories>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/OrderCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<OrderCategories>();
        }

        /// 
        public async Task<RestResponse<OrderCategorySummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/OrderCategories/Summary").Get<OrderCategorySummaries>();
        }

        /// <summary>
        /// Get the details of an order category by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<OrderCategory>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/OrderCategories/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<OrderCategory>();
        }

        /// <summary>
        /// Create a new order category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<OrderCategory>> Create(OrderCategory data)
        {
            return await restClient.AtUrl("ReferenceData/OrderCategories/").Post<OrderCategory, OrderCategory>(data);
        }

        /// <summary>
        /// Update an existing order category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<OrderCategory>> Update(string id, OrderCategory data)
        {
             var urlTemplate = "ReferenceData/OrderCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<OrderCategory, OrderCategory>(data);
        }

        /// <summary>
        /// Delete an existing order category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/OrderCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class OrderCategoriesFacadeBatch
    {
        private IRestClient restClient;

        public OrderCategoriesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all order categories. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.OrderCategories";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/OrderCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.OrderCategorySummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/OrderCategories/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of an order category by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.OrderCategory";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/OrderCategories/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new order category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(OrderCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.OrderCategory";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/OrderCategories/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing order category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, OrderCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.OrderCategory";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/OrderCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing order category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/OrderCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class OrganizationsFacade
    {
        private IRestClient restClient;

        public OrganizationsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all organizations. To get the resources in maintenance mode (ignoring control groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        public async Task<RestResponse<Organizations>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/Organizations/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Organizations>();
        }

        /// 
        public async Task<RestResponse<OrganizationSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/Organizations/Summary").Get<OrganizationSummaries>();
        }

        /// <summary>
        /// Get the details of an organization by ID. To get the resources in maintenance mode (ignoring control groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        public async Task<RestResponse<Organization>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/Organizations/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Organization>();
        }

        /// <summary>
        /// Create a new organization.
        /// </summary>
        public async Task<RestResponse<Organization>> Create(Organization data)
        {
            return await restClient.AtUrl("ReferenceData/Organizations/").Post<Organization, Organization>(data);
        }

        /// <summary>
        /// Update an existing organization.
        /// </summary>
        public async Task<RestResponse<Organization>> Update(string id, Organization data)
        {
             var urlTemplate = "ReferenceData/Organizations/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<Organization, Organization>(data);
        }

        /// <summary>
        /// Delete an existing organization.
        /// </summary>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/Organizations/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class OrganizationsFacadeBatch
    {
        private IRestClient restClient;

        public OrganizationsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all organizations. To get the resources in maintenance mode (ignoring control groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Organizations";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Organizations/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.OrganizationSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Organizations/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of an organization by ID. To get the resources in maintenance mode (ignoring control groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Organization";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Organizations/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new organization.
        /// </summary>
        public Request Create(Organization data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Organization";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Organizations/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing organization.
        /// </summary>
        public Request Update(string id, Organization data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Organization";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/Organizations/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing organization.
        /// </summary>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Organizations/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class OriginalSourcesFacade
    {
        private IRestClient restClient;

        public OriginalSourcesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all original sources. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<OriginalSources>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/OriginalSources/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<OriginalSources>();
        }

        /// 
        public async Task<RestResponse<OriginalSourceSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/OriginalSources/Summary").Get<OriginalSourceSummaries>();
        }

        /// <summary>
        /// Get the details of an original source by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<OriginalSource>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/OriginalSources/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<OriginalSource>();
        }

        /// <summary>
        /// Create a new original source.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<OriginalSource>> Create(OriginalSource data)
        {
            return await restClient.AtUrl("ReferenceData/OriginalSources/").Post<OriginalSource, OriginalSource>(data);
        }

        /// <summary>
        /// Update an existing original source.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<OriginalSource>> Update(string id, OriginalSource data)
        {
             var urlTemplate = "ReferenceData/OriginalSources/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<OriginalSource, OriginalSource>(data);
        }

        /// <summary>
        /// Delete an existing original source.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/OriginalSources/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class OriginalSourcesFacadeBatch
    {
        private IRestClient restClient;

        public OriginalSourcesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all original sources. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.OriginalSources";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/OriginalSources/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.OriginalSourceSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/OriginalSources/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of an original source by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.OriginalSource";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/OriginalSources/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new original source.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(OriginalSource data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.OriginalSource";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/OriginalSources/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing original source.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, OriginalSource data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.OriginalSource";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/OriginalSources/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing original source.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/OriginalSources/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class OriginsFacade
    {
        private IRestClient restClient;

        public OriginsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all origins. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<Origins>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/Origins/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Origins>();
        }

        /// 
        public async Task<RestResponse<OriginSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/Origins/Summary").Get<OriginSummaries>();
        }

        /// <summary>
        /// Get the details of an origin by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Origin>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/Origins/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Origin>();
        }

        /// <summary>
        /// Create a new origin.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<Origin>> Create(Origin data)
        {
            return await restClient.AtUrl("ReferenceData/Origins/").Post<Origin, Origin>(data);
        }

        /// <summary>
        /// Update an existing origin.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Origin>> Update(string id, Origin data)
        {
             var urlTemplate = "ReferenceData/Origins/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<Origin, Origin>(data);
        }

        /// <summary>
        /// Delete an existing origin.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/Origins/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class OriginsFacadeBatch
    {
        private IRestClient restClient;

        public OriginsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all origins. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Origins";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Origins/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.OriginSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Origins/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of an origin by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Origin";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Origins/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new origin.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(Origin data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Origin";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Origins/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing origin.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, Origin data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Origin";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/Origins/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing origin.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Origins/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PackageTypesFacade
    {
        private IRestClient restClient;

        public PackageTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all package types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<PackageTypes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/PackageTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PackageTypes>();
        }

        /// 
        public async Task<RestResponse<PackageTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/PackageTypes/Summary").Get<PackageTypeSummaries>();
        }

        /// <summary>
        /// Get the details of a package type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PackageType>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/PackageTypes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PackageType>();
        }

        /// <summary>
        /// Create a new package type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<PackageType>> Create(PackageType data)
        {
            return await restClient.AtUrl("ReferenceData/PackageTypes/").Post<PackageType, PackageType>(data);
        }

        /// <summary>
        /// Update an existing package type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PackageType>> Update(string id, PackageType data)
        {
             var urlTemplate = "ReferenceData/PackageTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<PackageType, PackageType>(data);
        }

        /// <summary>
        /// Delete an existing package type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/PackageTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PackageTypesFacadeBatch
    {
        private IRestClient restClient;

        public PackageTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all package types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PackageTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PackageTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PackageTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PackageTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a package type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PackageType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PackageTypes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new package type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(PackageType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PackageType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PackageTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing package type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, PackageType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PackageType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/PackageTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing package type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PackageTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PaymentGatewayTransactionTypesFacade
    {
        private IRestClient restClient;

        public PaymentGatewayTransactionTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<PaymentGatewayTransactionTypes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/PaymentGatewayTransactionTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PaymentGatewayTransactionTypes>();
        }

        /// 
        public async Task<RestResponse<PaymentGatewayTransactionTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/PaymentGatewayTransactionTypes/Summary").Get<PaymentGatewayTransactionTypeSummaries>();
        }

        /// 
        public async Task<RestResponse<PaymentGatewayTransactionType>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/PaymentGatewayTransactionTypes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PaymentGatewayTransactionType>();
        }

        /// 
        public async Task<RestResponse<PaymentGatewayTransactionType>> Create(PaymentGatewayTransactionType data)
        {
            return await restClient.AtUrl("ReferenceData/PaymentGatewayTransactionTypes/").Post<PaymentGatewayTransactionType, PaymentGatewayTransactionType>(data);
        }

        /// 
        public async Task<RestResponse<PaymentGatewayTransactionType>> Update(string id, PaymentGatewayTransactionType data)
        {
             var urlTemplate = "ReferenceData/PaymentGatewayTransactionTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<PaymentGatewayTransactionType, PaymentGatewayTransactionType>(data);
        }

        /// 
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/PaymentGatewayTransactionTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PaymentGatewayTransactionTypesFacadeBatch
    {
        private IRestClient restClient;

        public PaymentGatewayTransactionTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentGatewayTransactionTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PaymentGatewayTransactionTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentGatewayTransactionTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PaymentGatewayTransactionTypes/Summary";

            return bRequest;
        }

        /// 
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentGatewayTransactionType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PaymentGatewayTransactionTypes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Create(PaymentGatewayTransactionType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentGatewayTransactionType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PaymentGatewayTransactionTypes/";

            return bRequest;
        }

        /// 
        public Request Update(string id, PaymentGatewayTransactionType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentGatewayTransactionType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/PaymentGatewayTransactionTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PaymentGatewayTransactionTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PaymentMethodGroupsFacade
    {
        private IRestClient restClient;

        public PaymentMethodGroupsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all payment method groups. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<PaymentMethodGroups>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/PaymentMethodGroups/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PaymentMethodGroups>();
        }

        /// 
        public async Task<RestResponse<PaymentMethodGroupSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/PaymentMethodGroups/Summary").Get<PaymentMethodGroupSummaries>();
        }

        /// <summary>
        /// Get the details of a payment method group by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PaymentMethodGroup>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/PaymentMethodGroups/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PaymentMethodGroup>();
        }

        /// <summary>
        /// Create a new payment method group.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<PaymentMethodGroup>> Create(PaymentMethodGroup data)
        {
            return await restClient.AtUrl("ReferenceData/PaymentMethodGroups/").Post<PaymentMethodGroup, PaymentMethodGroup>(data);
        }

        /// <summary>
        /// Update an existing payment method group.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PaymentMethodGroup>> Update(string id, PaymentMethodGroup data)
        {
             var urlTemplate = "ReferenceData/PaymentMethodGroups/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<PaymentMethodGroup, PaymentMethodGroup>(data);
        }

        /// <summary>
        /// Delete an existing payment method group.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/PaymentMethodGroups/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PaymentMethodGroupsFacadeBatch
    {
        private IRestClient restClient;

        public PaymentMethodGroupsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all payment method groups. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentMethodGroups";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PaymentMethodGroups/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentMethodGroupSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PaymentMethodGroups/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a payment method group by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentMethodGroup";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PaymentMethodGroups/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new payment method group.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(PaymentMethodGroup data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentMethodGroup";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PaymentMethodGroups/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing payment method group.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, PaymentMethodGroup data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentMethodGroup";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/PaymentMethodGroups/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing payment method group.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PaymentMethodGroups/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PaymentTypesFacade
    {
        private IRestClient restClient;

        public PaymentTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all payment types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<PaymentTypes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/PaymentTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PaymentTypes>();
        }

        /// 
        public async Task<RestResponse<PaymentTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/PaymentTypes/Summary").Get<PaymentTypeSummaries>();
        }

        /// <summary>
        /// Get the details of a payment type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PaymentType>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/PaymentTypes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PaymentType>();
        }

        /// <summary>
        /// Create a new payment type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<PaymentType>> Create(PaymentType data)
        {
            return await restClient.AtUrl("ReferenceData/PaymentTypes/").Post<PaymentType, PaymentType>(data);
        }

        /// <summary>
        /// Update an existing payment type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PaymentType>> Update(string id, PaymentType data)
        {
             var urlTemplate = "ReferenceData/PaymentTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<PaymentType, PaymentType>(data);
        }

        /// <summary>
        /// Delete an existing payment type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/PaymentTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PaymentTypesFacadeBatch
    {
        private IRestClient restClient;

        public PaymentTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all payment types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PaymentTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PaymentTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a payment type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PaymentTypes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new payment type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(PaymentType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PaymentTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing payment type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, PaymentType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/PaymentTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing payment type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PaymentTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PerformanceStatusesFacade
    {
        private IRestClient restClient;

        public PerformanceStatusesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all performance statuses. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformanceStatuses>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/PerformanceStatuses/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PerformanceStatuses>();
        }

        /// 
        public async Task<RestResponse<PerformanceStatusSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/PerformanceStatuses/Summary").Get<PerformanceStatusSummaries>();
        }

        /// <summary>
        /// Get the details of a performance status by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformanceStatus>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/PerformanceStatuses/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PerformanceStatus>();
        }

        /// <summary>
        /// Create a new performance status.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformanceStatus>> Create(PerformanceStatus data)
        {
            return await restClient.AtUrl("ReferenceData/PerformanceStatuses/").Post<PerformanceStatus, PerformanceStatus>(data);
        }

        /// <summary>
        /// Update an existing performance status.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformanceStatus>> Update(string id, PerformanceStatus data)
        {
             var urlTemplate = "ReferenceData/PerformanceStatuses/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<PerformanceStatus, PerformanceStatus>(data);
        }

        /// <summary>
        /// Delete an existing performance status.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/PerformanceStatuses/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PerformanceStatusesFacadeBatch
    {
        private IRestClient restClient;

        public PerformanceStatusesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all performance statuses. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformanceStatuses";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PerformanceStatuses/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformanceStatusSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PerformanceStatuses/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a performance status by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformanceStatus";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PerformanceStatuses/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new performance status.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(PerformanceStatus data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformanceStatus";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PerformanceStatuses/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing performance status.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, PerformanceStatus data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformanceStatus";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/PerformanceStatuses/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing performance status.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PerformanceStatuses/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PerformanceTypesFacade
    {
        private IRestClient restClient;

        public PerformanceTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all performance types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformanceTypes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/PerformanceTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PerformanceTypes>();
        }

        /// 
        public async Task<RestResponse<PerformanceTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/PerformanceTypes/Summary").Get<PerformanceTypeSummaries>();
        }

        /// <summary>
        /// Get the details of a performance type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformanceType>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/PerformanceTypes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PerformanceType>();
        }

        /// <summary>
        /// Create a new performance type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformanceType>> Create(PerformanceType data)
        {
            return await restClient.AtUrl("ReferenceData/PerformanceTypes/").Post<PerformanceType, PerformanceType>(data);
        }

        /// <summary>
        /// Update an existing performance type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformanceType>> Update(string id, PerformanceType data)
        {
             var urlTemplate = "ReferenceData/PerformanceTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<PerformanceType, PerformanceType>(data);
        }

        /// <summary>
        /// Delete an existing performance type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/PerformanceTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PerformanceTypesFacadeBatch
    {
        private IRestClient restClient;

        public PerformanceTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all performance types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformanceTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PerformanceTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformanceTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PerformanceTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a performance type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformanceType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PerformanceTypes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new performance type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(PerformanceType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformanceType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PerformanceTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing performance type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, PerformanceType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformanceType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/PerformanceTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing performance type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PerformanceTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PhoneIndicatorsFacade
    {
        private IRestClient restClient;

        public PhoneIndicatorsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all phone indicators. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<PhoneIndicators>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/PhoneIndicators/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PhoneIndicators>();
        }

        /// 
        public async Task<RestResponse<PhoneIndicatorSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/PhoneIndicators/Summary").Get<PhoneIndicatorSummaries>();
        }

        /// <summary>
        /// Get the details of a phone indicator by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PhoneIndicator>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/PhoneIndicators/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PhoneIndicator>();
        }

        /// <summary>
        /// Create a new phone indicator.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<PhoneIndicator>> Create(PhoneIndicator data)
        {
            return await restClient.AtUrl("ReferenceData/PhoneIndicators/").Post<PhoneIndicator, PhoneIndicator>(data);
        }

        /// <summary>
        /// Update an existing phone indicator.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PhoneIndicator>> Update(string id, PhoneIndicator data)
        {
             var urlTemplate = "ReferenceData/PhoneIndicators/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<PhoneIndicator, PhoneIndicator>(data);
        }

        /// <summary>
        /// Delete an existing phone indicator.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/PhoneIndicators/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PhoneIndicatorsFacadeBatch
    {
        private IRestClient restClient;

        public PhoneIndicatorsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all phone indicators. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PhoneIndicators";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PhoneIndicators/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PhoneIndicatorSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PhoneIndicators/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a phone indicator by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PhoneIndicator";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PhoneIndicators/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new phone indicator.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(PhoneIndicator data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PhoneIndicator";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PhoneIndicators/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing phone indicator.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, PhoneIndicator data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PhoneIndicator";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/PhoneIndicators/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing phone indicator.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PhoneIndicators/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PhoneTypesFacade
    {
        private IRestClient restClient;

        public PhoneTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all phone types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<PhoneTypes>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/PhoneTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PhoneTypes>();
        }

        /// 
        public async Task<RestResponse<PhoneTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/PhoneTypes/Summary").Get<PhoneTypeSummaries>();
        }

        /// <summary>
        /// Get the details of a phone type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PhoneType>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/PhoneTypes/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PhoneType>();
        }

        /// <summary>
        /// Create a new phone type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<PhoneType>> Create(PhoneType data)
        {
            return await restClient.AtUrl("ReferenceData/PhoneTypes/").Post<PhoneType, PhoneType>(data);
        }

        /// <summary>
        /// Update an existing phone type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PhoneType>> Update(string id, PhoneType data)
        {
             var urlTemplate = "ReferenceData/PhoneTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<PhoneType, PhoneType>(data);
        }

        /// <summary>
        /// Delete an existing phone type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/PhoneTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PhoneTypesFacadeBatch
    {
        private IRestClient restClient;

        public PhoneTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all phone types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PhoneTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PhoneTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PhoneTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PhoneTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a phone type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PhoneType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PhoneTypes/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new phone type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(PhoneType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PhoneType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PhoneTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing phone type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, PhoneType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PhoneType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/PhoneTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing phone type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PhoneTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PlanPrioritiesFacade
    {
        private IRestClient restClient;

        public PlanPrioritiesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all plan priorities. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<PlanPriorities>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/PlanPriorities/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PlanPriorities>();
        }

        /// 
        public async Task<RestResponse<PlanPrioritySummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/PlanPriorities/Summary").Get<PlanPrioritySummaries>();
        }

        /// <summary>
        /// Get the details of a plan priority by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PlanPriority>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/PlanPriorities/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PlanPriority>();
        }

        /// <summary>
        /// Create a new plan priority.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<PlanPriority>> Create(PlanPriority data)
        {
            return await restClient.AtUrl("ReferenceData/PlanPriorities/").Post<PlanPriority, PlanPriority>(data);
        }

        /// <summary>
        /// Update an existing plan priority.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PlanPriority>> Update(string id, PlanPriority data)
        {
             var urlTemplate = "ReferenceData/PlanPriorities/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<PlanPriority, PlanPriority>(data);
        }

        /// <summary>
        /// Delete an existing plan priority.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/PlanPriorities/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PlanPrioritiesFacadeBatch
    {
        private IRestClient restClient;

        public PlanPrioritiesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all plan priorities. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PlanPriorities";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PlanPriorities/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PlanPrioritySummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PlanPriorities/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a plan priority by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PlanPriority";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PlanPriorities/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new plan priority.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(PlanPriority data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PlanPriority";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PlanPriorities/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing plan priority.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, PlanPriority data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PlanPriority";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/PlanPriorities/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing plan priority.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PlanPriorities/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PlanSourcesFacade
    {
        private IRestClient restClient;

        public PlanSourcesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all plan sources. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<PlanSources>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/PlanSources/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PlanSources>();
        }

        /// 
        public async Task<RestResponse<PlanSourceSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/PlanSources/Summary").Get<PlanSourceSummaries>();
        }

        /// <summary>
        /// Get the details of a plan source by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PlanSource>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/PlanSources/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PlanSource>();
        }

        /// <summary>
        /// Create a new plan source.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<PlanSource>> Create(PlanSource data)
        {
            return await restClient.AtUrl("ReferenceData/PlanSources/").Post<PlanSource, PlanSource>(data);
        }

        /// <summary>
        /// Update an existing plan source.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PlanSource>> Update(string id, PlanSource data)
        {
             var urlTemplate = "ReferenceData/PlanSources/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<PlanSource, PlanSource>(data);
        }

        /// <summary>
        /// Delete an existing plan source.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/PlanSources/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PlanSourcesFacadeBatch
    {
        private IRestClient restClient;

        public PlanSourcesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all plan sources. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PlanSources";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PlanSources/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PlanSourceSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PlanSources/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a plan source by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PlanSource";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PlanSources/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new plan source.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(PlanSource data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PlanSource";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PlanSources/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing plan source.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, PlanSource data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PlanSource";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/PlanSources/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing plan source.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PlanSources/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PlanStatusesFacade
    {
        private IRestClient restClient;

        public PlanStatusesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all plan statuses. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<PlanStatuses>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/PlanStatuses/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PlanStatuses>();
        }

        /// 
        public async Task<RestResponse<PlanStatusSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/PlanStatuses/Summary").Get<PlanStatusSummaries>();
        }

        /// <summary>
        /// Get the details of a plan status by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PlanStatus>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/PlanStatuses/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PlanStatus>();
        }

        /// <summary>
        /// Create a new plan status.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<PlanStatus>> Create(PlanStatus data)
        {
            return await restClient.AtUrl("ReferenceData/PlanStatuses/").Post<PlanStatus, PlanStatus>(data);
        }

        /// <summary>
        /// Update an existing plan status.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PlanStatus>> Update(string id, PlanStatus data)
        {
             var urlTemplate = "ReferenceData/PlanStatuses/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<PlanStatus, PlanStatus>(data);
        }

        /// <summary>
        /// Delete an existing plan status.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/PlanStatuses/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PlanStatusesFacadeBatch
    {
        private IRestClient restClient;

        public PlanStatusesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all plan statuses. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PlanStatuses";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PlanStatuses/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PlanStatusSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PlanStatuses/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a plan status by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PlanStatus";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PlanStatuses/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new plan status.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(PlanStatus data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PlanStatus";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PlanStatuses/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing plan status.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, PlanStatus data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PlanStatus";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/PlanStatuses/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing plan status.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PlanStatuses/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PlanTypesFacade
    {
        private IRestClient restClient;

        public PlanTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all plan types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<PlanTypes>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/PlanTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PlanTypes>();
        }

        /// 
        public async Task<RestResponse<PlanTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/PlanTypes/Summary").Get<PlanTypeSummaries>();
        }

        /// <summary>
        /// Get the details of a plan type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PlanType>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/PlanTypes/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PlanType>();
        }

        /// <summary>
        /// Create a new plan type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<PlanType>> Create(PlanType data)
        {
            return await restClient.AtUrl("ReferenceData/PlanTypes/").Post<PlanType, PlanType>(data);
        }

        /// <summary>
        /// Update an existing plan type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PlanType>> Update(string id, PlanType data)
        {
             var urlTemplate = "ReferenceData/PlanTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<PlanType, PlanType>(data);
        }

        /// <summary>
        /// Delete an existing plan type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/PlanTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PlanTypesFacadeBatch
    {
        private IRestClient restClient;

        public PlanTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all plan types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PlanTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PlanTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PlanTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PlanTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a plan type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PlanType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PlanTypes/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new plan type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(PlanType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PlanType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PlanTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing plan type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, PlanType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PlanType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/PlanTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing plan type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PlanTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PortfolioCustomElementsFacade
    {
        private IRestClient restClient;

        public PortfolioCustomElementsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all portfolio custom elements. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<PortfolioCustomElements>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/PortfolioCustomElements/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PortfolioCustomElements>();
        }

        /// 
        public async Task<RestResponse<PortfolioCustomElementSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/PortfolioCustomElements/Summary").Get<PortfolioCustomElementSummaries>();
        }

        /// <summary>
        /// Get the details of a portfolio custom element by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PortfolioCustomElement>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/PortfolioCustomElements/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PortfolioCustomElement>();
        }

        /// <summary>
        /// Create a new portfolio custom element.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<PortfolioCustomElement>> Create(PortfolioCustomElement data)
        {
            return await restClient.AtUrl("ReferenceData/PortfolioCustomElements/").Post<PortfolioCustomElement, PortfolioCustomElement>(data);
        }

        /// <summary>
        /// Update an existing portfolio custom element.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PortfolioCustomElement>> Update(string id, PortfolioCustomElement data)
        {
             var urlTemplate = "ReferenceData/PortfolioCustomElements/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<PortfolioCustomElement, PortfolioCustomElement>(data);
        }

        /// <summary>
        /// Delete an existing portfolio custom element.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/PortfolioCustomElements/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PortfolioCustomElementsFacadeBatch
    {
        private IRestClient restClient;

        public PortfolioCustomElementsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all portfolio custom elements. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PortfolioCustomElements";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PortfolioCustomElements/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PortfolioCustomElementSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PortfolioCustomElements/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a portfolio custom element by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PortfolioCustomElement";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PortfolioCustomElements/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new portfolio custom element.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(PortfolioCustomElement data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PortfolioCustomElement";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PortfolioCustomElements/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing portfolio custom element.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, PortfolioCustomElement data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PortfolioCustomElement";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/PortfolioCustomElements/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing portfolio custom element.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PortfolioCustomElements/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PrefixesFacade
    {
        private IRestClient restClient;

        public PrefixesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all prefixes. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<Prefixes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/Prefixes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Prefixes>();
        }

        /// 
        public async Task<RestResponse<PrefixSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/Prefixes/Summary").Get<PrefixSummaries>();
        }

        /// <summary>
        /// Get the details of a prefix by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Prefix>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/Prefixes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Prefix>();
        }

        /// <summary>
        /// Create a new prefix.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<Prefix>> Create(Prefix data)
        {
            return await restClient.AtUrl("ReferenceData/Prefixes/").Post<Prefix, Prefix>(data);
        }

        /// <summary>
        /// Update an existing prefix.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Prefix>> Update(string id, Prefix data)
        {
             var urlTemplate = "ReferenceData/Prefixes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<Prefix, Prefix>(data);
        }

        /// <summary>
        /// Delete an existing prefix.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/Prefixes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PrefixesFacadeBatch
    {
        private IRestClient restClient;

        public PrefixesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all prefixes. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Prefixes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Prefixes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PrefixSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Prefixes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a prefix by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Prefix";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Prefixes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new prefix.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(Prefix data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Prefix";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Prefixes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing prefix.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, Prefix data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Prefix";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/Prefixes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing prefix.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Prefixes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PremieresFacade
    {
        private IRestClient restClient;

        public PremieresFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all premieres. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<Premieres>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/Premieres/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Premieres>();
        }

        /// 
        public async Task<RestResponse<PremiereSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/Premieres/Summary").Get<PremiereSummaries>();
        }

        /// <summary>
        /// Get the details of a premiere by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Premiere>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/Premieres/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Premiere>();
        }

        /// <summary>
        /// Create a new premiere.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<Premiere>> Create(Premiere data)
        {
            return await restClient.AtUrl("ReferenceData/Premieres/").Post<Premiere, Premiere>(data);
        }

        /// <summary>
        /// Update an existing premiere.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Premiere>> Update(string id, Premiere data)
        {
             var urlTemplate = "ReferenceData/Premieres/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<Premiere, Premiere>(data);
        }

        /// <summary>
        /// Delete an existing premiere.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/Premieres/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PremieresFacadeBatch
    {
        private IRestClient restClient;

        public PremieresFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all premieres. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Premieres";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Premieres/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PremiereSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Premieres/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a premiere by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Premiere";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Premieres/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new premiere.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(Premiere data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Premiere";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Premieres/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing premiere.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, Premiere data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Premiere";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/Premieres/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing premiere.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Premieres/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PriceCategoriesFacade
    {
        private IRestClient restClient;

        public PriceCategoriesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all price categories. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceCategories>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/PriceCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PriceCategories>();
        }

        /// 
        public async Task<RestResponse<PriceCategorySummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/PriceCategories/Summary").Get<PriceCategorySummaries>();
        }

        /// <summary>
        /// Get the details of a price category by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceCategory>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/PriceCategories/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PriceCategory>();
        }

        /// <summary>
        /// Create a new price category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceCategory>> Create(PriceCategory data)
        {
            return await restClient.AtUrl("ReferenceData/PriceCategories/").Post<PriceCategory, PriceCategory>(data);
        }

        /// <summary>
        /// Update an existing price category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceCategory>> Update(string id, PriceCategory data)
        {
             var urlTemplate = "ReferenceData/PriceCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<PriceCategory, PriceCategory>(data);
        }

        /// <summary>
        /// Delete an existing price category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/PriceCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PriceCategoriesFacadeBatch
    {
        private IRestClient restClient;

        public PriceCategoriesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all price categories. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceCategories";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PriceCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceCategorySummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PriceCategories/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a price category by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceCategory";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PriceCategories/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new price category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(PriceCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceCategory";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PriceCategories/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing price category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, PriceCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceCategory";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/PriceCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing price category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PriceCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PriceLayerTypesFacade
    {
        private IRestClient restClient;

        public PriceLayerTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all price layer types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceLayerTypes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/PriceLayerTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PriceLayerTypes>();
        }

        /// 
        public async Task<RestResponse<PriceLayerTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/PriceLayerTypes/Summary").Get<PriceLayerTypeSummaries>();
        }

        /// <summary>
        /// Get the details of a price layer type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceLayerType>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/PriceLayerTypes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PriceLayerType>();
        }

        /// <summary>
        /// Create a new price layer type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceLayerType>> Create(PriceLayerType data)
        {
            return await restClient.AtUrl("ReferenceData/PriceLayerTypes/").Post<PriceLayerType, PriceLayerType>(data);
        }

        /// <summary>
        /// Update an existing price layer type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceLayerType>> Update(string id, PriceLayerType data)
        {
             var urlTemplate = "ReferenceData/PriceLayerTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<PriceLayerType, PriceLayerType>(data);
        }

        /// <summary>
        /// Delete an existing price layer type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/PriceLayerTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PriceLayerTypesFacadeBatch
    {
        private IRestClient restClient;

        public PriceLayerTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all price layer types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceLayerTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PriceLayerTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceLayerTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PriceLayerTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a price layer type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceLayerType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PriceLayerTypes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new price layer type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(PriceLayerType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceLayerType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PriceLayerTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing price layer type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, PriceLayerType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceLayerType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/PriceLayerTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing price layer type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PriceLayerTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PriceTypeCategoriesFacade
    {
        private IRestClient restClient;

        public PriceTypeCategoriesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all price type categories. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceTypeCategories>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/PriceTypeCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PriceTypeCategories>();
        }

        /// 
        public async Task<RestResponse<PriceTypeCategorySummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/PriceTypeCategories/Summary").Get<PriceTypeCategorySummaries>();
        }

        /// <summary>
        /// Get the details of a price type category by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceTypeCategory>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/PriceTypeCategories/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PriceTypeCategory>();
        }

        /// <summary>
        /// Create a new price type category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceTypeCategory>> Create(PriceTypeCategory data)
        {
            return await restClient.AtUrl("ReferenceData/PriceTypeCategories/").Post<PriceTypeCategory, PriceTypeCategory>(data);
        }

        /// <summary>
        /// Update an existing price type category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceTypeCategory>> Update(string id, PriceTypeCategory data)
        {
             var urlTemplate = "ReferenceData/PriceTypeCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<PriceTypeCategory, PriceTypeCategory>(data);
        }

        /// <summary>
        /// Delete an existing price type category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/PriceTypeCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PriceTypeCategoriesFacadeBatch
    {
        private IRestClient restClient;

        public PriceTypeCategoriesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all price type categories. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTypeCategories";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PriceTypeCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTypeCategorySummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PriceTypeCategories/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a price type category by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTypeCategory";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PriceTypeCategories/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new price type category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(PriceTypeCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTypeCategory";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PriceTypeCategories/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing price type category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, PriceTypeCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTypeCategory";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/PriceTypeCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing price type category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PriceTypeCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PriceTypeGroupsFacade
    {
        private IRestClient restClient;

        public PriceTypeGroupsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all price type groups. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceTypeGroups>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/PriceTypeGroups/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PriceTypeGroups>();
        }

        /// 
        public async Task<RestResponse<PriceTypeGroupSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/PriceTypeGroups/Summary").Get<PriceTypeGroupSummaries>();
        }

        /// <summary>
        /// Get the details of a price type group by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceTypeGroup>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/PriceTypeGroups/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PriceTypeGroup>();
        }

        /// <summary>
        /// Create a new price type group.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceTypeGroup>> Create(PriceTypeGroup data)
        {
            return await restClient.AtUrl("ReferenceData/PriceTypeGroups/").Post<PriceTypeGroup, PriceTypeGroup>(data);
        }

        /// <summary>
        /// Update an existing price type group.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceTypeGroup>> Update(string id, PriceTypeGroup data)
        {
             var urlTemplate = "ReferenceData/PriceTypeGroups/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<PriceTypeGroup, PriceTypeGroup>(data);
        }

        /// <summary>
        /// Delete an existing price type group.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/PriceTypeGroups/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PriceTypeGroupsFacadeBatch
    {
        private IRestClient restClient;

        public PriceTypeGroupsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all price type groups. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTypeGroups";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PriceTypeGroups/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTypeGroupSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PriceTypeGroups/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a price type group by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTypeGroup";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PriceTypeGroups/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new price type group.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(PriceTypeGroup data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTypeGroup";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PriceTypeGroups/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing price type group.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, PriceTypeGroup data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTypeGroup";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/PriceTypeGroups/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing price type group.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PriceTypeGroups/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PriceTypeReasonsFacade
    {
        private IRestClient restClient;

        public PriceTypeReasonsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all price type reasons. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceTypeReasons>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/PriceTypeReasons/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PriceTypeReasons>();
        }

        /// 
        public async Task<RestResponse<PriceTypeReasonSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/PriceTypeReasons/Summary").Get<PriceTypeReasonSummaries>();
        }

        /// <summary>
        /// Get the details of a price type reason by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceTypeReason>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/PriceTypeReasons/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PriceTypeReason>();
        }

        /// <summary>
        /// Create a new price type reason.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceTypeReason>> Create(PriceTypeReason data)
        {
            return await restClient.AtUrl("ReferenceData/PriceTypeReasons/").Post<PriceTypeReason, PriceTypeReason>(data);
        }

        /// <summary>
        /// Update an existing price type reason.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceTypeReason>> Update(string id, PriceTypeReason data)
        {
             var urlTemplate = "ReferenceData/PriceTypeReasons/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<PriceTypeReason, PriceTypeReason>(data);
        }

        /// <summary>
        /// Delete an existing price type reason.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/PriceTypeReasons/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PriceTypeReasonsFacadeBatch
    {
        private IRestClient restClient;

        public PriceTypeReasonsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all price type reasons. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTypeReasons";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PriceTypeReasons/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTypeReasonSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PriceTypeReasons/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a price type reason by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTypeReason";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PriceTypeReasons/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new price type reason.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(PriceTypeReason data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTypeReason";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PriceTypeReasons/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing price type reason.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, PriceTypeReason data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTypeReason";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/PriceTypeReasons/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing price type reason.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PriceTypeReasons/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PricingRuleCategoriesFacade
    {
        private IRestClient restClient;

        public PricingRuleCategoriesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all pricing rule categories. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<PricingRuleCategories>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/PricingRuleCategories/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PricingRuleCategories>();
        }

        /// 
        public async Task<RestResponse<PricingRuleCategorySummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/PricingRuleCategories/Summary").Get<PricingRuleCategorySummaries>();
        }

        /// <summary>
        /// Get the details of a pricing rule category by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PricingRuleCategory>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/PricingRuleCategories/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PricingRuleCategory>();
        }

        /// <summary>
        /// Create a new pricing rule category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<PricingRuleCategory>> Create(PricingRuleCategory data)
        {
            return await restClient.AtUrl("ReferenceData/PricingRuleCategories/").Post<PricingRuleCategory, PricingRuleCategory>(data);
        }

        /// <summary>
        /// Update an existing pricing rule category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PricingRuleCategory>> Update(string id, PricingRuleCategory data)
        {
             var urlTemplate = "ReferenceData/PricingRuleCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<PricingRuleCategory, PricingRuleCategory>(data);
        }

        /// <summary>
        /// Delete an existing pricing rule category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/PricingRuleCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PricingRuleCategoriesFacadeBatch
    {
        private IRestClient restClient;

        public PricingRuleCategoriesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all pricing rule categories. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PricingRuleCategories";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PricingRuleCategories/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PricingRuleCategorySummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PricingRuleCategories/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a pricing rule category by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PricingRuleCategory";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PricingRuleCategories/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new pricing rule category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(PricingRuleCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PricingRuleCategory";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PricingRuleCategories/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing pricing rule category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, PricingRuleCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PricingRuleCategory";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/PricingRuleCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing pricing rule category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PricingRuleCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PricingRuleMessageTypesFacade
    {
        private IRestClient restClient;

        public PricingRuleMessageTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all pricing rule message types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<PricingRuleMessageTypes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/PricingRuleMessageTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PricingRuleMessageTypes>();
        }

        /// 
        public async Task<RestResponse<PricingRuleMessageTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/PricingRuleMessageTypes/Summary").Get<PricingRuleMessageTypeSummaries>();
        }

        /// <summary>
        /// Get the details of a pricing rule message type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PricingRuleMessageType>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/PricingRuleMessageTypes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PricingRuleMessageType>();
        }

        /// <summary>
        /// Create a new pricing rule message type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<PricingRuleMessageType>> Create(PricingRuleMessageType data)
        {
            return await restClient.AtUrl("ReferenceData/PricingRuleMessageTypes/").Post<PricingRuleMessageType, PricingRuleMessageType>(data);
        }

        /// <summary>
        /// Update an existing pricing rule message type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PricingRuleMessageType>> Update(string id, PricingRuleMessageType data)
        {
             var urlTemplate = "ReferenceData/PricingRuleMessageTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<PricingRuleMessageType, PricingRuleMessageType>(data);
        }

        /// <summary>
        /// Delete an existing pricing rule message type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/PricingRuleMessageTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PricingRuleMessageTypesFacadeBatch
    {
        private IRestClient restClient;

        public PricingRuleMessageTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all pricing rule message types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PricingRuleMessageTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PricingRuleMessageTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PricingRuleMessageTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PricingRuleMessageTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a pricing rule message type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PricingRuleMessageType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PricingRuleMessageTypes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new pricing rule message type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(PricingRuleMessageType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PricingRuleMessageType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PricingRuleMessageTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing pricing rule message type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, PricingRuleMessageType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PricingRuleMessageType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/PricingRuleMessageTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing pricing rule message type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PricingRuleMessageTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PricingRuleTypesFacade
    {
        private IRestClient restClient;

        public PricingRuleTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all pricing rule types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<PricingRuleTypes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/PricingRuleTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PricingRuleTypes>();
        }

        /// 
        public async Task<RestResponse<PricingRuleTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/PricingRuleTypes/Summary").Get<PricingRuleTypeSummaries>();
        }

        /// <summary>
        /// Get the details of a pricing rule type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PricingRuleType>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/PricingRuleTypes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PricingRuleType>();
        }

    }
 

 
    /// 
    public class PricingRuleTypesFacadeBatch
    {
        private IRestClient restClient;

        public PricingRuleTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all pricing rule types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PricingRuleTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PricingRuleTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PricingRuleTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/PricingRuleTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a pricing rule type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PricingRuleType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/PricingRuleTypes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PrintersFacade
    {
        private IRestClient restClient;

        public PrintersFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all printers. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<Printers>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/Printers/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Printers>();
        }

        /// 
        public async Task<RestResponse<PrinterSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/Printers/Summary").Get<PrinterSummaries>();
        }

        /// <summary>
        /// Get the details of a printer by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Printer>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/Printers/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Printer>();
        }

        /// <summary>
        /// Create a new printer.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<Printer>> Create(Printer data)
        {
            return await restClient.AtUrl("ReferenceData/Printers/").Post<Printer, Printer>(data);
        }

        /// <summary>
        /// Update an existing printer.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Printer>> Update(string id, Printer data)
        {
             var urlTemplate = "ReferenceData/Printers/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<Printer, Printer>(data);
        }

        /// <summary>
        /// Delete an existing printer.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/Printers/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PrintersFacadeBatch
    {
        private IRestClient restClient;

        public PrintersFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all printers. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Printers";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Printers/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PrinterSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Printers/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a printer by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Printer";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Printers/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new printer.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(Printer data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Printer";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Printers/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing printer.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, Printer data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Printer";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/Printers/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing printer.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Printers/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ProgramsFacade
    {
        private IRestClient restClient;

        public ProgramsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all programs. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<Programs>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/Programs/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Programs>();
        }

        /// 
        public async Task<RestResponse<ProgramSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/Programs/Summary").Get<ProgramSummaries>();
        }

        /// <summary>
        /// Get the details of a program by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Tessitura.Service.Contract.Program>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/Programs/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Tessitura.Service.Contract.Program>();
        }

        /// <summary>
        /// Create a new program.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<Tessitura.Service.Contract.Program>> Create(Tessitura.Service.Contract.Program data)
        {
            return await restClient.AtUrl("ReferenceData/Programs/").Post<Tessitura.Service.Contract.Program, Tessitura.Service.Contract.Program>(data);
        }

        /// <summary>
        /// Update an existing program.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Tessitura.Service.Contract.Program>> Update(string id, Tessitura.Service.Contract.Program data)
        {
             var urlTemplate = "ReferenceData/Programs/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<Tessitura.Service.Contract.Program, Tessitura.Service.Contract.Program>(data);
        }

        /// <summary>
        /// Delete an existing program.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/Programs/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ProgramsFacadeBatch
    {
        private IRestClient restClient;

        public ProgramsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all programs. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Programs";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Programs/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ProgramSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Programs/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a program by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Program";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Programs/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new program.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(Tessitura.Service.Contract.Program data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Program";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Programs/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing program.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, Tessitura.Service.Contract.Program data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Program";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/Programs/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing program.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Programs/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class QualificationCategoriesFacade
    {
        private IRestClient restClient;

        public QualificationCategoriesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<QualificationCategories>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/QualificationCategories/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<QualificationCategories>();
        }

        /// 
        public async Task<RestResponse<QualificationCategorySummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/QualificationCategories/Summary").Get<QualificationCategorySummaries>();
        }

        /// 
        public async Task<RestResponse<QualificationCategory>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/QualificationCategories/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<QualificationCategory>();
        }

        /// 
        public async Task<RestResponse<QualificationCategory>> Create(QualificationCategory data)
        {
            return await restClient.AtUrl("ReferenceData/QualificationCategories/").Post<QualificationCategory, QualificationCategory>(data);
        }

        /// 
        public async Task<RestResponse<QualificationCategory>> Update(string id, QualificationCategory data)
        {
             var urlTemplate = "ReferenceData/QualificationCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<QualificationCategory, QualificationCategory>(data);
        }

        /// 
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/QualificationCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class QualificationCategoriesFacadeBatch
    {
        private IRestClient restClient;

        public QualificationCategoriesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.QualificationCategories";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/QualificationCategories/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.QualificationCategorySummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/QualificationCategories/Summary";

            return bRequest;
        }

        /// 
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.QualificationCategory";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/QualificationCategories/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Create(QualificationCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.QualificationCategory";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/QualificationCategories/";

            return bRequest;
        }

        /// 
        public Request Update(string id, QualificationCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.QualificationCategory";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/QualificationCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/QualificationCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class QualificationsFacade
    {
        private IRestClient restClient;

        public QualificationsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<Qualifications>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/Qualifications/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Qualifications>();
        }

        /// 
        public async Task<RestResponse<QualificationSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/Qualifications/Summary").Get<QualificationSummaries>();
        }

        /// 
        public async Task<RestResponse<Qualification>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/Qualifications/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Qualification>();
        }

        /// 
        public async Task<RestResponse<Qualification>> Create(Qualification data)
        {
            return await restClient.AtUrl("ReferenceData/Qualifications/").Post<Qualification, Qualification>(data);
        }

        /// 
        public async Task<RestResponse<Qualification>> Update(string id, Qualification data)
        {
             var urlTemplate = "ReferenceData/Qualifications/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<Qualification, Qualification>(data);
        }

        /// 
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/Qualifications/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class QualificationsFacadeBatch
    {
        private IRestClient restClient;

        public QualificationsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Qualifications";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Qualifications/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.QualificationSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Qualifications/Summary";

            return bRequest;
        }

        /// 
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Qualification";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Qualifications/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Create(Qualification data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Qualification";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Qualifications/";

            return bRequest;
        }

        /// 
        public Request Update(string id, Qualification data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Qualification";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/Qualifications/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Qualifications/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class QueryElementsFacade
    {
        private IRestClient restClient;

        public QueryElementsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<QueryElements>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/QueryElements/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<QueryElements>();
        }

        /// 
        public async Task<RestResponse<QueryElementSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/QueryElements/Summary").Get<QueryElementSummaries>();
        }

        /// 
        public async Task<RestResponse<QueryElement>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/QueryElements/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<QueryElement>();
        }

        /// 
        public async Task<RestResponse<QueryElement>> Create(QueryElement data)
        {
            return await restClient.AtUrl("ReferenceData/QueryElements/").Post<QueryElement, QueryElement>(data);
        }

        /// 
        public async Task<RestResponse<QueryElement>> Update(string id, QueryElement data)
        {
             var urlTemplate = "ReferenceData/QueryElements/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<QueryElement, QueryElement>(data);
        }

        /// 
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/QueryElements/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class QueryElementsFacadeBatch
    {
        private IRestClient restClient;

        public QueryElementsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.QueryElements";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/QueryElements/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.QueryElementSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/QueryElements/Summary";

            return bRequest;
        }

        /// 
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.QueryElement";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/QueryElements/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Create(QueryElement data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.QueryElement";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/QueryElements/";

            return bRequest;
        }

        /// 
        public Request Update(string id, QueryElement data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.QueryElement";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/QueryElements/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/QueryElements/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class RankTypesFacade
    {
        private IRestClient restClient;

        public RankTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all rank types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<RankTypes>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/RankTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<RankTypes>();
        }

        /// 
        public async Task<RestResponse<RankTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/RankTypes/Summary").Get<RankTypeSummaries>();
        }

        /// <summary>
        /// Get the details of a rank type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<RankType>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/RankTypes/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<RankType>();
        }

        /// <summary>
        /// Create a new rank type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<RankType>> Create(RankType data)
        {
            return await restClient.AtUrl("ReferenceData/RankTypes/").Post<RankType, RankType>(data);
        }

        /// <summary>
        /// Update an existing rank type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<RankType>> Update(string id, RankType data)
        {
             var urlTemplate = "ReferenceData/RankTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<RankType, RankType>(data);
        }

        /// <summary>
        /// Delete an existing rank type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/RankTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class RankTypesFacadeBatch
    {
        private IRestClient restClient;

        public RankTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all rank types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.RankTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/RankTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.RankTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/RankTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a rank type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.RankType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/RankTypes/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new rank type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(RankType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.RankType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/RankTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing rank type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, RankType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.RankType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/RankTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing rank type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/RankTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ReceiptSettingsFacade
    {
        private IRestClient restClient;

        public ReceiptSettingsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<ReceiptSettings>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ReceiptSettings/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ReceiptSettings>();
        }

        /// 
        public async Task<RestResponse<ReceiptSettingSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ReceiptSettings/Summary").Get<ReceiptSettingSummaries>();
        }

        /// 
        public async Task<RestResponse<ReceiptSetting>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/ReceiptSettings/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ReceiptSetting>();
        }

        /// 
        public async Task<RestResponse<ReceiptSetting>> Create(ReceiptSetting data)
        {
            return await restClient.AtUrl("ReferenceData/ReceiptSettings/").Post<ReceiptSetting, ReceiptSetting>(data);
        }

        /// 
        public async Task<RestResponse<ReceiptSetting>> Update(string id, ReceiptSetting data)
        {
             var urlTemplate = "ReferenceData/ReceiptSettings/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<ReceiptSetting, ReceiptSetting>(data);
        }

        /// 
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/ReceiptSettings/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ReceiptSettingsFacadeBatch
    {
        private IRestClient restClient;

        public ReceiptSettingsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ReceiptSettings";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ReceiptSettings/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ReceiptSettingSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ReceiptSettings/Summary";

            return bRequest;
        }

        /// 
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ReceiptSetting";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ReceiptSettings/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Create(ReceiptSetting data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ReceiptSetting";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ReceiptSettings/";

            return bRequest;
        }

        /// 
        public Request Update(string id, ReceiptSetting data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ReceiptSetting";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/ReceiptSettings/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ReceiptSettings/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ReferenceColumnsFacade
    {
        private IRestClient restClient;

        public ReferenceColumnsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all reference columns. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<ReferenceColumns>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ReferenceColumns/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ReferenceColumns>();
        }

        /// 
        public async Task<RestResponse<ReferenceColumnSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ReferenceColumns/Summary").Get<ReferenceColumnSummaries>();
        }

    }
 

 
    /// 
    public class ReferenceColumnsFacadeBatch
    {
        private IRestClient restClient;

        public ReferenceColumnsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all reference columns. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ReferenceColumns";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ReferenceColumns/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ReferenceColumnSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ReferenceColumns/Summary";

            return bRequest;
        }

    }
 

 
    /// 
    public class ReferenceTablesFacade
    {
        private IRestClient restClient;

        public ReferenceTablesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all reference tables. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<ReferenceTables>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ReferenceTables/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ReferenceTables>();
        }

        /// 
        public async Task<RestResponse<ReferenceTableSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ReferenceTables/Summary").Get<ReferenceTableSummaries>();
        }

    }
 

 
    /// 
    public class ReferenceTablesFacadeBatch
    {
        private IRestClient restClient;

        public ReferenceTablesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all reference tables. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ReferenceTables";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ReferenceTables/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ReferenceTableSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ReferenceTables/Summary";

            return bRequest;
        }

    }
 

 
    /// 
    public class RelationshipCategoriesFacade
    {
        private IRestClient restClient;

        public RelationshipCategoriesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all relationship categories. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<RelationshipCategories>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/RelationshipCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<RelationshipCategories>();
        }

        /// 
        public async Task<RestResponse<RelationshipCategorySummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/RelationshipCategories/Summary").Get<RelationshipCategorySummaries>();
        }

        /// <summary>
        /// Get the details of a relationship category by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<RelationshipCategory>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/RelationshipCategories/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<RelationshipCategory>();
        }

        /// <summary>
        /// Create a new relationship category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<RelationshipCategory>> Create(RelationshipCategory data)
        {
            return await restClient.AtUrl("ReferenceData/RelationshipCategories/").Post<RelationshipCategory, RelationshipCategory>(data);
        }

        /// <summary>
        /// Update an existing relationship category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<RelationshipCategory>> Update(string id, RelationshipCategory data)
        {
             var urlTemplate = "ReferenceData/RelationshipCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<RelationshipCategory, RelationshipCategory>(data);
        }

        /// <summary>
        /// Delete an existing relationship category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/RelationshipCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class RelationshipCategoriesFacadeBatch
    {
        private IRestClient restClient;

        public RelationshipCategoriesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all relationship categories. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.RelationshipCategories";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/RelationshipCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.RelationshipCategorySummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/RelationshipCategories/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a relationship category by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.RelationshipCategory";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/RelationshipCategories/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new relationship category.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(RelationshipCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.RelationshipCategory";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/RelationshipCategories/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing relationship category.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, RelationshipCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.RelationshipCategory";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/RelationshipCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing relationship category.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/RelationshipCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ResourceCategoriesFacade
    {
        private IRestClient restClient;

        public ResourceCategoriesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<ResourceCategories>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ResourceCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ResourceCategories>();
        }

        /// 
        public async Task<RestResponse<ResourceCategorySummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ResourceCategories/Summary").Get<ResourceCategorySummaries>();
        }

        /// 
        public async Task<RestResponse<ResourceCategory>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/ResourceCategories/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ResourceCategory>();
        }

        /// 
        public async Task<RestResponse<ResourceCategory>> Create(ResourceCategory data)
        {
            return await restClient.AtUrl("ReferenceData/ResourceCategories/").Post<ResourceCategory, ResourceCategory>(data);
        }

        /// 
        public async Task<RestResponse<ResourceCategory>> Update(string id, ResourceCategory data)
        {
             var urlTemplate = "ReferenceData/ResourceCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<ResourceCategory, ResourceCategory>(data);
        }

        /// 
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/ResourceCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ResourceCategoriesFacadeBatch
    {
        private IRestClient restClient;

        public ResourceCategoriesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ResourceCategories";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ResourceCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ResourceCategorySummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ResourceCategories/Summary";

            return bRequest;
        }

        /// 
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ResourceCategory";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ResourceCategories/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Create(ResourceCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ResourceCategory";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ResourceCategories/";

            return bRequest;
        }

        /// 
        public Request Update(string id, ResourceCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ResourceCategory";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/ResourceCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ResourceCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class SalesChannelsFacade
    {
        private IRestClient restClient;

        public SalesChannelsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all sales channels. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<SalesChannels>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/SalesChannels/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<SalesChannels>();
        }

        /// 
        public async Task<RestResponse<SalesChannelSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/SalesChannels/Summary").Get<SalesChannelSummaries>();
        }

        /// <summary>
        /// Get the details of a sales channel by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<SalesChannel>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/SalesChannels/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<SalesChannel>();
        }

        /// <summary>
        /// Create a new sales channel.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<SalesChannel>> Create(SalesChannel data)
        {
            return await restClient.AtUrl("ReferenceData/SalesChannels/").Post<SalesChannel, SalesChannel>(data);
        }

        /// <summary>
        /// Update an existing sales channel.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<SalesChannel>> Update(string id, SalesChannel data)
        {
             var urlTemplate = "ReferenceData/SalesChannels/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<SalesChannel, SalesChannel>(data);
        }

        /// <summary>
        /// Delete an existing sales channel.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/SalesChannels/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class SalesChannelsFacadeBatch
    {
        private IRestClient restClient;

        public SalesChannelsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all sales channels. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SalesChannels";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SalesChannels/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SalesChannelSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/SalesChannels/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a sales channel by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SalesChannel";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SalesChannels/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new sales channel.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(SalesChannel data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SalesChannel";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/SalesChannels/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing sales channel.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, SalesChannel data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SalesChannel";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/SalesChannels/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing sales channel.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SalesChannels/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class SalesLayoutButtonTypesFacade
    {
        private IRestClient restClient;

        public SalesLayoutButtonTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all sales layout button types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<SalesLayoutButtonTypes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/SalesLayoutButtonTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<SalesLayoutButtonTypes>();
        }

        /// 
        public async Task<RestResponse<SalesLayoutButtonTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/SalesLayoutButtonTypes/Summary").Get<SalesLayoutButtonTypeSummaries>();
        }

        /// <summary>
        /// Get the details of a sales layout button type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<SalesLayoutButtonType>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/SalesLayoutButtonTypes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<SalesLayoutButtonType>();
        }

        /// <summary>
        /// Create a new sales layout button type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<SalesLayoutButtonType>> Create(SalesLayoutButtonType data)
        {
            return await restClient.AtUrl("ReferenceData/SalesLayoutButtonTypes/").Post<SalesLayoutButtonType, SalesLayoutButtonType>(data);
        }

        /// <summary>
        /// Update an existing sales layout button type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<SalesLayoutButtonType>> Update(string id, SalesLayoutButtonType data)
        {
             var urlTemplate = "ReferenceData/SalesLayoutButtonTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<SalesLayoutButtonType, SalesLayoutButtonType>(data);
        }

        /// <summary>
        /// Delete an existing sales layout button type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/SalesLayoutButtonTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class SalesLayoutButtonTypesFacadeBatch
    {
        private IRestClient restClient;

        public SalesLayoutButtonTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all sales layout button types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SalesLayoutButtonTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SalesLayoutButtonTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SalesLayoutButtonTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/SalesLayoutButtonTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a sales layout button type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SalesLayoutButtonType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SalesLayoutButtonTypes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new sales layout button type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(SalesLayoutButtonType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SalesLayoutButtonType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/SalesLayoutButtonTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing sales layout button type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, SalesLayoutButtonType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SalesLayoutButtonType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/SalesLayoutButtonTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing sales layout button type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SalesLayoutButtonTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class SalutationTypesFacade
    {
        private IRestClient restClient;

        public SalutationTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all salutation types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<SalutationTypes>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/SalutationTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<SalutationTypes>();
        }

        /// 
        public async Task<RestResponse<SalutationTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/SalutationTypes/Summary").Get<SalutationTypeSummaries>();
        }

        /// <summary>
        /// Get the details of a salutation type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<SalutationType>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/SalutationTypes/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<SalutationType>();
        }

        /// <summary>
        /// Create a new salutation type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<SalutationType>> Create(SalutationType data)
        {
            return await restClient.AtUrl("ReferenceData/SalutationTypes/").Post<SalutationType, SalutationType>(data);
        }

        /// <summary>
        /// Update an existing salutation type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<SalutationType>> Update(string id, SalutationType data)
        {
             var urlTemplate = "ReferenceData/SalutationTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<SalutationType, SalutationType>(data);
        }

        /// <summary>
        /// Delete an existing salutation type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/SalutationTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class SalutationTypesFacadeBatch
    {
        private IRestClient restClient;

        public SalutationTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all salutation types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SalutationTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SalutationTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SalutationTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/SalutationTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a salutation type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SalutationType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SalutationTypes/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new salutation type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(SalutationType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SalutationType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/SalutationTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing salutation type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, SalutationType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SalutationType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/SalutationTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing salutation type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SalutationTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class SchedulePatternTypesFacade
    {
        private IRestClient restClient;

        public SchedulePatternTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<SchedulePatternTypes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/SchedulePatternTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<SchedulePatternTypes>();
        }

        /// 
        public async Task<RestResponse<SchedulePatternTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/SchedulePatternTypes/Summary").Get<SchedulePatternTypeSummaries>();
        }

        /// 
        public async Task<RestResponse<SchedulePatternType>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/SchedulePatternTypes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<SchedulePatternType>();
        }

        /// 
        public async Task<RestResponse<SchedulePatternType>> Create(SchedulePatternType data)
        {
            return await restClient.AtUrl("ReferenceData/SchedulePatternTypes/").Post<SchedulePatternType, SchedulePatternType>(data);
        }

        /// 
        public async Task<RestResponse<SchedulePatternType>> Update(string id, SchedulePatternType data)
        {
             var urlTemplate = "ReferenceData/SchedulePatternTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<SchedulePatternType, SchedulePatternType>(data);
        }

        /// 
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/SchedulePatternTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class SchedulePatternTypesFacadeBatch
    {
        private IRestClient restClient;

        public SchedulePatternTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SchedulePatternTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SchedulePatternTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SchedulePatternTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/SchedulePatternTypes/Summary";

            return bRequest;
        }

        /// 
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SchedulePatternType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SchedulePatternTypes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Create(SchedulePatternType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SchedulePatternType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/SchedulePatternTypes/";

            return bRequest;
        }

        /// 
        public Request Update(string id, SchedulePatternType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SchedulePatternType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/SchedulePatternTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SchedulePatternTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ScheduleTypesFacade
    {
        private IRestClient restClient;

        public ScheduleTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<ScheduleTypes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ScheduleTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ScheduleTypes>();
        }

        /// 
        public async Task<RestResponse<ScheduleTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ScheduleTypes/Summary").Get<ScheduleTypeSummaries>();
        }

        /// 
        public async Task<RestResponse<ScheduleType>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/ScheduleTypes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ScheduleType>();
        }

        /// 
        public async Task<RestResponse<ScheduleType>> Create(ScheduleType data)
        {
            return await restClient.AtUrl("ReferenceData/ScheduleTypes/").Post<ScheduleType, ScheduleType>(data);
        }

        /// 
        public async Task<RestResponse<ScheduleType>> Update(string id, ScheduleType data)
        {
             var urlTemplate = "ReferenceData/ScheduleTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<ScheduleType, ScheduleType>(data);
        }

        /// 
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/ScheduleTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ScheduleTypesFacadeBatch
    {
        private IRestClient restClient;

        public ScheduleTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ScheduleTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ScheduleTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ScheduleTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ScheduleTypes/Summary";

            return bRequest;
        }

        /// 
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ScheduleType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ScheduleTypes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Create(ScheduleType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ScheduleType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ScheduleTypes/";

            return bRequest;
        }

        /// 
        public Request Update(string id, ScheduleType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ScheduleType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/ScheduleTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ScheduleTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class SeasonsFacade
    {
        private IRestClient restClient;

        public SeasonsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all seasons. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<Seasons>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/Seasons/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Seasons>();
        }

        /// 
        public async Task<RestResponse<SeasonSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/Seasons/Summary").Get<SeasonSummaries>();
        }

        /// <summary>
        /// Get the details of a season by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Season>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/Seasons/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Season>();
        }

        /// <summary>
        /// Create a new season.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<Season>> Create(Season data)
        {
            return await restClient.AtUrl("ReferenceData/Seasons/").Post<Season, Season>(data);
        }

        /// <summary>
        /// Update an existing season.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Season>> Update(string id, Season data)
        {
             var urlTemplate = "ReferenceData/Seasons/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<Season, Season>(data);
        }

        /// <summary>
        /// Delete an existing season.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/Seasons/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class SeasonsFacadeBatch
    {
        private IRestClient restClient;

        public SeasonsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all seasons. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Seasons";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Seasons/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SeasonSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Seasons/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a season by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Season";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Seasons/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new season.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(Season data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Season";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Seasons/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing season.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, Season data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Season";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/Seasons/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing season.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Seasons/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class SeasonTypesFacade
    {
        private IRestClient restClient;

        public SeasonTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all season types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<SeasonTypes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/SeasonTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<SeasonTypes>();
        }

        /// 
        public async Task<RestResponse<SeasonTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/SeasonTypes/Summary").Get<SeasonTypeSummaries>();
        }

        /// <summary>
        /// Get the details of a season type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<SeasonType>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/SeasonTypes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<SeasonType>();
        }

        /// <summary>
        /// Create a new season type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<SeasonType>> Create(SeasonType data)
        {
            return await restClient.AtUrl("ReferenceData/SeasonTypes/").Post<SeasonType, SeasonType>(data);
        }

        /// <summary>
        /// Update an existing season type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<SeasonType>> Update(string id, SeasonType data)
        {
             var urlTemplate = "ReferenceData/SeasonTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<SeasonType, SeasonType>(data);
        }

        /// <summary>
        /// Delete an existing season type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/SeasonTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class SeasonTypesFacadeBatch
    {
        private IRestClient restClient;

        public SeasonTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all season types. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SeasonTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SeasonTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SeasonTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/SeasonTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a season type by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SeasonType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SeasonTypes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new season type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(SeasonType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SeasonType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/SeasonTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing season type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, SeasonType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SeasonType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/SeasonTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing season type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SeasonTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class SeatCodesFacade
    {
        private IRestClient restClient;

        public SeatCodesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all seat codes. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<SeatCodes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/SeatCodes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<SeatCodes>();
        }

        /// 
        public async Task<RestResponse<SeatCodeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/SeatCodes/Summary").Get<SeatCodeSummaries>();
        }

        /// <summary>
        /// Get the details of a seat code by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<SeatCode>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/SeatCodes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<SeatCode>();
        }

        /// <summary>
        /// Create a new seat code.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<SeatCode>> Create(SeatCode data)
        {
            return await restClient.AtUrl("ReferenceData/SeatCodes/").Post<SeatCode, SeatCode>(data);
        }

        /// <summary>
        /// Update an existing seat code.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<SeatCode>> Update(string id, SeatCode data)
        {
             var urlTemplate = "ReferenceData/SeatCodes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<SeatCode, SeatCode>(data);
        }

        /// <summary>
        /// Delete an existing seat code.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/SeatCodes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class SeatCodesFacadeBatch
    {
        private IRestClient restClient;

        public SeatCodesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all seat codes. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SeatCodes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SeatCodes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SeatCodeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/SeatCodes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a seat code by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SeatCode";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SeatCodes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new seat code.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(SeatCode data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SeatCode";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/SeatCodes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing seat code.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, SeatCode data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SeatCode";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/SeatCodes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing seat code.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SeatCodes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class SeatStatusesFacade
    {
        private IRestClient restClient;

        public SeatStatusesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all seat statuses. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<SeatStatuses>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/SeatStatuses/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<SeatStatuses>();
        }

        /// 
        public async Task<RestResponse<SeatStatusSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/SeatStatuses/Summary").Get<SeatStatusSummaries>();
        }

        /// <summary>
        /// Get the details of a seat status by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<SeatStatus>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/SeatStatuses/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<SeatStatus>();
        }

        /// <summary>
        /// Create a new seat status.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<SeatStatus>> Create(SeatStatus data)
        {
            return await restClient.AtUrl("ReferenceData/SeatStatuses/").Post<SeatStatus, SeatStatus>(data);
        }

        /// <summary>
        /// Update an existing seat status.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<SeatStatus>> Update(string id, SeatStatus data)
        {
             var urlTemplate = "ReferenceData/SeatStatuses/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<SeatStatus, SeatStatus>(data);
        }

        /// <summary>
        /// Delete an existing seat status.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/SeatStatuses/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class SeatStatusesFacadeBatch
    {
        private IRestClient restClient;

        public SeatStatusesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all seat statuses. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SeatStatuses";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SeatStatuses/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SeatStatusSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/SeatStatuses/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a seat status by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SeatStatus";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SeatStatuses/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new seat status.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(SeatStatus data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SeatStatus";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/SeatStatuses/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing seat status.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, SeatStatus data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SeatStatus";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/SeatStatuses/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing seat status.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SeatStatuses/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class SectionsFacade
    {
        private IRestClient restClient;

        public SectionsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all sections. To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="seatMapId">If seatMapId is supplied, only sections located within the specified seat map will be returned.</param>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<Sections>> GetAll(string seatMapId = "null", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/Sections/?seatMapId={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, seatMapId,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Sections>();
        }

        /// 
        public async Task<RestResponse<SectionSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/Sections/Summary").Get<SectionSummaries>();
        }

        /// <summary>
        /// Get the details of a section by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Section>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/Sections/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Section>();
        }

        /// <summary>
        /// Create a new section.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<Section>> Create(Section data)
        {
            return await restClient.AtUrl("ReferenceData/Sections/").Post<Section, Section>(data);
        }

        /// <summary>
        /// Update an existing section.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Section>> Update(string id, Section data)
        {
             var urlTemplate = "ReferenceData/Sections/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<Section, Section>(data);
        }

        /// <summary>
        /// Delete an existing section.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/Sections/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class SectionsFacadeBatch
    {
        private IRestClient restClient;

        public SectionsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all sections. To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="seatMapId">If seatMapId is supplied, only sections located within the specified seat map will be returned.</param>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string seatMapId = "null", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Sections";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Sections/?seatMapId={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, seatMapId,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SectionSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Sections/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a section by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Section";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Sections/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new section.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(Section data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Section";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Sections/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing section.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, Section data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Section";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/Sections/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing section.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Sections/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ServiceResourcesFacade
    {
        private IRestClient restClient;

        public ServiceResourcesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all service resources. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<ServiceResources>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ServiceResources/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ServiceResources>();
        }

        /// 
        public async Task<RestResponse<ServiceResourceSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ServiceResources/Summary").Get<ServiceResourceSummaries>();
        }

    }
 

 
    /// 
    public class ServiceResourcesFacadeBatch
    {
        private IRestClient restClient;

        public ServiceResourcesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all service resources. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ServiceResources";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ServiceResources/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ServiceResourceSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ServiceResources/Summary";

            return bRequest;
        }

    }
 

 
    /// 
    public class SourceGroupsFacade
    {
        private IRestClient restClient;

        public SourceGroupsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all source groups. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<SourceGroups>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/SourceGroups/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<SourceGroups>();
        }

        /// 
        public async Task<RestResponse<SourceGroupSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/SourceGroups/Summary").Get<SourceGroupSummaries>();
        }

        /// <summary>
        /// Get the details of a source group by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<SourceGroup>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/SourceGroups/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<SourceGroup>();
        }

        /// <summary>
        /// Create a new source group.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<SourceGroup>> Create(SourceGroup data)
        {
            return await restClient.AtUrl("ReferenceData/SourceGroups/").Post<SourceGroup, SourceGroup>(data);
        }

        /// <summary>
        /// Update an existing source group.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<SourceGroup>> Update(string id, SourceGroup data)
        {
             var urlTemplate = "ReferenceData/SourceGroups/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<SourceGroup, SourceGroup>(data);
        }

        /// <summary>
        /// Delete an existing source group.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/SourceGroups/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class SourceGroupsFacadeBatch
    {
        private IRestClient restClient;

        public SourceGroupsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all source groups. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SourceGroups";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SourceGroups/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SourceGroupSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/SourceGroups/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a source group by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SourceGroup";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SourceGroups/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new source group.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(SourceGroup data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SourceGroup";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/SourceGroups/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing source group.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, SourceGroup data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SourceGroup";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/SourceGroups/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing source group.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SourceGroups/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class SpecialActivityStatusesFacade
    {
        private IRestClient restClient;

        public SpecialActivityStatusesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<SpecialActivityStatuses>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/SpecialActivityStatuses/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<SpecialActivityStatuses>();
        }

        /// 
        public async Task<RestResponse<SpecialActivityStatusSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/SpecialActivityStatuses/Summary").Get<SpecialActivityStatusSummaries>();
        }

        /// 
        public async Task<RestResponse<SpecialActivityStatus>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/SpecialActivityStatuses/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<SpecialActivityStatus>();
        }

        /// 
        public async Task<RestResponse<SpecialActivityStatus>> Create(SpecialActivityStatus data)
        {
            return await restClient.AtUrl("ReferenceData/SpecialActivityStatuses/").Post<SpecialActivityStatus, SpecialActivityStatus>(data);
        }

        /// 
        public async Task<RestResponse<SpecialActivityStatus>> Update(string id, SpecialActivityStatus data)
        {
             var urlTemplate = "ReferenceData/SpecialActivityStatuses/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<SpecialActivityStatus, SpecialActivityStatus>(data);
        }

        /// 
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/SpecialActivityStatuses/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class SpecialActivityStatusesFacadeBatch
    {
        private IRestClient restClient;

        public SpecialActivityStatusesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SpecialActivityStatuses";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SpecialActivityStatuses/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SpecialActivityStatusSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/SpecialActivityStatuses/Summary";

            return bRequest;
        }

        /// 
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SpecialActivityStatus";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SpecialActivityStatuses/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Create(SpecialActivityStatus data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SpecialActivityStatus";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/SpecialActivityStatuses/";

            return bRequest;
        }

        /// 
        public Request Update(string id, SpecialActivityStatus data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SpecialActivityStatus";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/SpecialActivityStatuses/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SpecialActivityStatuses/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class SpecialActivityTypesFacade
    {
        private IRestClient restClient;

        public SpecialActivityTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<SpecialActivityTypes>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/SpecialActivityTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<SpecialActivityTypes>();
        }

        /// 
        public async Task<RestResponse<SpecialActivityTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/SpecialActivityTypes/Summary").Get<SpecialActivityTypeSummaries>();
        }

        /// 
        public async Task<RestResponse<SpecialActivityType>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/SpecialActivityTypes/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<SpecialActivityType>();
        }

        /// 
        public async Task<RestResponse<SpecialActivityType>> Create(SpecialActivityType data)
        {
            return await restClient.AtUrl("ReferenceData/SpecialActivityTypes/").Post<SpecialActivityType, SpecialActivityType>(data);
        }

        /// 
        public async Task<RestResponse<SpecialActivityType>> Update(string id, SpecialActivityType data)
        {
             var urlTemplate = "ReferenceData/SpecialActivityTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<SpecialActivityType, SpecialActivityType>(data);
        }

        /// 
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/SpecialActivityTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class SpecialActivityTypesFacadeBatch
    {
        private IRestClient restClient;

        public SpecialActivityTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SpecialActivityTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SpecialActivityTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SpecialActivityTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/SpecialActivityTypes/Summary";

            return bRequest;
        }

        /// 
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SpecialActivityType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SpecialActivityTypes/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Create(SpecialActivityType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SpecialActivityType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/SpecialActivityTypes/";

            return bRequest;
        }

        /// 
        public Request Update(string id, SpecialActivityType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SpecialActivityType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/SpecialActivityTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SpecialActivityTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class StatesFacade
    {
        private IRestClient restClient;

        public StatesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all states. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<States>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/States/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<States>();
        }

        /// 
        public async Task<RestResponse<StateSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/States/Summary").Get<StateSummaries>();
        }

        /// <summary>
        /// Get the details of a state by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<State>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/States/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<State>();
        }

        /// <summary>
        /// Create a new state.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<State>> Create(State data)
        {
            return await restClient.AtUrl("ReferenceData/States/").Post<State, State>(data);
        }

        /// <summary>
        /// Update an existing state.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<State>> Update(string id, State data)
        {
             var urlTemplate = "ReferenceData/States/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<State, State>(data);
        }

        /// <summary>
        /// Delete an existing state.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/States/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class StatesFacadeBatch
    {
        private IRestClient restClient;

        public StatesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all states. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.States";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/States/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.StateSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/States/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a state by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.State";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/States/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new state.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(State data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.State";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/States/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing state.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, State data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.State";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/States/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing state.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/States/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class StepTypesFacade
    {
        private IRestClient restClient;

        public StepTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all step types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<StepTypes>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/StepTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<StepTypes>();
        }

        /// 
        public async Task<RestResponse<StepTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/StepTypes/Summary").Get<StepTypeSummaries>();
        }

        /// <summary>
        /// Get the details of a step type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<StepType>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/StepTypes/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<StepType>();
        }

        /// <summary>
        /// Create a new step type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<StepType>> Create(StepType data)
        {
            return await restClient.AtUrl("ReferenceData/StepTypes/").Post<StepType, StepType>(data);
        }

        /// <summary>
        /// Update an existing step type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<StepType>> Update(string id, StepType data)
        {
             var urlTemplate = "ReferenceData/StepTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<StepType, StepType>(data);
        }

        /// <summary>
        /// Delete an existing step type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/StepTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class StepTypesFacadeBatch
    {
        private IRestClient restClient;

        public StepTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all step types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.StepTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/StepTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.StepTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/StepTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a step type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.StepType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/StepTypes/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new step type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(StepType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.StepType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/StepTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing step type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, StepType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.StepType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/StepTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing step type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/StepTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class SubLineItemStatusesFacade
    {
        private IRestClient restClient;

        public SubLineItemStatusesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all sub line item statuses. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<SubLineItemStatuses>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/SubLineItemStatuses/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<SubLineItemStatuses>();
        }

        /// 
        public async Task<RestResponse<SubLineItemStatusSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/SubLineItemStatuses/Summary").Get<SubLineItemStatusSummaries>();
        }

        /// <summary>
        /// Get the details of a sub line item status by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<SubLineItemStatus>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/SubLineItemStatuses/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<SubLineItemStatus>();
        }

        /// <summary>
        /// Create a new sub line item status.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<SubLineItemStatus>> Create(SubLineItemStatus data)
        {
            return await restClient.AtUrl("ReferenceData/SubLineItemStatuses/").Post<SubLineItemStatus, SubLineItemStatus>(data);
        }

        /// <summary>
        /// Update an existing sub line item status.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<SubLineItemStatus>> Update(string id, SubLineItemStatus data)
        {
             var urlTemplate = "ReferenceData/SubLineItemStatuses/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<SubLineItemStatus, SubLineItemStatus>(data);
        }

        /// <summary>
        /// Delete an existing sub line item status.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/SubLineItemStatuses/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class SubLineItemStatusesFacadeBatch
    {
        private IRestClient restClient;

        public SubLineItemStatusesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all sub line item statuses. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SubLineItemStatuses";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SubLineItemStatuses/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SubLineItemStatusSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/SubLineItemStatuses/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a sub line item status by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SubLineItemStatus";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SubLineItemStatuses/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new sub line item status.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(SubLineItemStatus data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SubLineItemStatus";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/SubLineItemStatuses/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing sub line item status.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, SubLineItemStatus data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SubLineItemStatus";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/SubLineItemStatuses/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing sub line item status.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SubLineItemStatuses/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class SuffixesFacade
    {
        private IRestClient restClient;

        public SuffixesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all suffixes. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<Suffixes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/Suffixes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Suffixes>();
        }

        /// 
        public async Task<RestResponse<SuffixSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/Suffixes/Summary").Get<SuffixSummaries>();
        }

        /// <summary>
        /// Get the details of a suffix by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Suffix>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/Suffixes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Suffix>();
        }

        /// <summary>
        /// Create a new suffix.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<Suffix>> Create(Suffix data)
        {
            return await restClient.AtUrl("ReferenceData/Suffixes/").Post<Suffix, Suffix>(data);
        }

        /// <summary>
        /// Update an existing suffix.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Suffix>> Update(string id, Suffix data)
        {
             var urlTemplate = "ReferenceData/Suffixes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<Suffix, Suffix>(data);
        }

        /// <summary>
        /// Delete an existing suffix.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/Suffixes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class SuffixesFacadeBatch
    {
        private IRestClient restClient;

        public SuffixesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all suffixes. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Suffixes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Suffixes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SuffixSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Suffixes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a suffix by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Suffix";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Suffixes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new suffix.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(Suffix data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Suffix";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Suffixes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing suffix.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, Suffix data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Suffix";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/Suffixes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing suffix.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Suffixes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class SurveyQuestionsFacade
    {
        private IRestClient restClient;

        public SurveyQuestionsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<SurveyQuestions>> GetAll(string modeOfSaleId = "null", string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/SurveyQuestions/?modeOfSaleId={0}&filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, modeOfSaleId,filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<SurveyQuestions>();
        }

        /// 
        public async Task<RestResponse<SurveyQuestionSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/SurveyQuestions/Summary").Get<SurveyQuestionSummaries>();
        }

        /// <summary>
        /// Get the details of a survey question by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<SurveyQuestion>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/SurveyQuestions/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<SurveyQuestion>();
        }

        /// <summary>
        /// Create a new survey question.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<SurveyQuestion>> Create(SurveyQuestion data)
        {
            return await restClient.AtUrl("ReferenceData/SurveyQuestions/").Post<SurveyQuestion, SurveyQuestion>(data);
        }

        /// <summary>
        /// Update an existing survey question.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<SurveyQuestion>> Update(string id, SurveyQuestion data)
        {
             var urlTemplate = "ReferenceData/SurveyQuestions/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<SurveyQuestion, SurveyQuestion>(data);
        }

        /// <summary>
        /// Delete an existing survey question.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/SurveyQuestions/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// 
        public async Task<RestResponse<SurveyQuestionDataItems>> GetDataFor(string questionId)
        {
            var urlTemplate = "ReferenceData/SurveyQuestions/Data/?questionId={0}";
            urlTemplate = string.Format(urlTemplate, questionId);
            return await restClient.AtUrl(urlTemplate).Get<SurveyQuestionDataItems>();
        }

    }
 

 
    /// 
    public class SurveyQuestionsFacadeBatch
    {
        private IRestClient restClient;

        public SurveyQuestionsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(string modeOfSaleId = "null", string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SurveyQuestions";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SurveyQuestions/?modeOfSaleId={0}&filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, modeOfSaleId,filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SurveyQuestionSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/SurveyQuestions/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a survey question by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SurveyQuestion";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SurveyQuestions/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new survey question.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(SurveyQuestion data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SurveyQuestion";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/SurveyQuestions/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing survey question.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, SurveyQuestion data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SurveyQuestion";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/SurveyQuestions/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing survey question.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SurveyQuestions/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetDataFor(string questionId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SurveyQuestionDataItems";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SurveyQuestions/Data/?questionId={0}";
            urlTemplate = string.Format(urlTemplate, questionId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class SystemDefaultsFacade
    {
        private IRestClient restClient;

        public SystemDefaultsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all system defaults. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<SystemDefaults>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/SystemDefaults/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<SystemDefaults>();
        }

        /// 
        public async Task<RestResponse<SystemDefaultSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/SystemDefaults/Summary").Get<SystemDefaultSummaries>();
        }

    }
 

 
    /// 
    public class SystemDefaultsFacadeBatch
    {
        private IRestClient restClient;

        public SystemDefaultsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all system defaults. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SystemDefaults";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/SystemDefaults/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SystemDefaultSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/SystemDefaults/Summary";

            return bRequest;
        }

    }
 

 
    /// 
    public class TemplateCategoriesFacade
    {
        private IRestClient restClient;

        public TemplateCategoriesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all template categories. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<TemplateCategories>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/TemplateCategories/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<TemplateCategories>();
        }

        /// 
        public async Task<RestResponse<TemplateCategorySummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/TemplateCategories/Summary").Get<TemplateCategorySummaries>();
        }

        /// <summary>
        /// Get the details of a template category by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="id"></param>
        /// <param name="filter"></param>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<TemplateCategory>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/TemplateCategories/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<TemplateCategory>();
        }

        /// <summary>
        /// Create a new template category
        /// </summary>
        /// <param name="templateCategory"></param>
        /// <returns></returns>
        public async Task<RestResponse<TemplateCategory>> Create(TemplateCategory templateCategory)
        {
            return await restClient.AtUrl("ReferenceData/TemplateCategories/").Post<TemplateCategory, TemplateCategory>(templateCategory);
        }

        /// <summary>
        /// Update an existing template category
        /// </summary>
        /// <param name="id"></param>
        /// <param name="templateCategory"></param>
        /// <returns></returns>
        public async Task<RestResponse<TemplateCategory>> Update(string id, TemplateCategory templateCategory)
        {
             var urlTemplate = "ReferenceData/TemplateCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<TemplateCategory, TemplateCategory>(templateCategory);
        }

        /// <summary>
        /// Delete a template category
        /// </summary>
        /// <param name="id"></param>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/TemplateCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class TemplateCategoriesFacadeBatch
    {
        private IRestClient restClient;

        public TemplateCategoriesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all template categories. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TemplateCategories";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/TemplateCategories/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TemplateCategorySummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/TemplateCategories/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a template category by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="id"></param>
        /// <param name="filter"></param>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TemplateCategory";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/TemplateCategories/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new template category
        /// </summary>
        /// <param name="templateCategory"></param>
        /// <returns></returns>
        public Request Create(TemplateCategory templateCategory, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TemplateCategory";
            bRequest.Content = templateCategory;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/TemplateCategories/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing template category
        /// </summary>
        /// <param name="id"></param>
        /// <param name="templateCategory"></param>
        /// <returns></returns>
        public Request Update(string id, TemplateCategory templateCategory, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TemplateCategory";
            bRequest.Content = templateCategory;

            var urlTemplate = "ReferenceData/TemplateCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete a template category
        /// </summary>
        /// <param name="id"></param>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/TemplateCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class TemplateTypesFacade
    {
        private IRestClient restClient;

        public TemplateTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all template types. To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<TemplateTypes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/TemplateTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<TemplateTypes>();
        }

        /// 
        public async Task<RestResponse<TemplateTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/TemplateTypes/Summary").Get<TemplateTypeSummaries>();
        }

        /// <summary>
        /// Get the details of a template type by id. To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="id"></param>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<TemplateType>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/TemplateTypes/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<TemplateType>();
        }

    }
 

 
    /// 
    public class TemplateTypesFacadeBatch
    {
        private IRestClient restClient;

        public TemplateTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all template types. To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TemplateTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/TemplateTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TemplateTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/TemplateTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a template type by id. To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="id"></param>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TemplateType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/TemplateTypes/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class TheatersFacade
    {
        private IRestClient restClient;

        public TheatersFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all theaters. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<Theaters>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/Theaters/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Theaters>();
        }

        /// 
        public async Task<RestResponse<TheaterSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/Theaters/Summary").Get<TheaterSummaries>();
        }

        /// <summary>
        /// Get the details of a theater by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Theater>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/Theaters/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<Theater>();
        }

        /// <summary>
        /// Create a new theater.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<Theater>> Create(Theater data)
        {
            return await restClient.AtUrl("ReferenceData/Theaters/").Post<Theater, Theater>(data);
        }

        /// <summary>
        /// Update an existing theater.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Theater>> Update(string id, Theater data)
        {
             var urlTemplate = "ReferenceData/Theaters/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<Theater, Theater>(data);
        }

        /// <summary>
        /// Delete an existing theater.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/Theaters/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class TheatersFacadeBatch
    {
        private IRestClient restClient;

        public TheatersFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all theaters. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Theaters";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Theaters/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TheaterSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Theaters/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a theater by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Theater";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Theaters/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new theater.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(Theater data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Theater";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/Theaters/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing theater.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, Theater data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Theater";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/Theaters/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing theater.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/Theaters/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class TimeSlotsFacade
    {
        private IRestClient restClient;

        public TimeSlotsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all time slots. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<TimeSlots>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/TimeSlots/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<TimeSlots>();
        }

        /// 
        public async Task<RestResponse<TimeSlotSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/TimeSlots/Summary").Get<TimeSlotSummaries>();
        }

        /// <summary>
        /// Get the details of a time slot by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<TimeSlot>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/TimeSlots/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<TimeSlot>();
        }

        /// <summary>
        /// Create a new time slot.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<TimeSlot>> Create(TimeSlot data)
        {
            return await restClient.AtUrl("ReferenceData/TimeSlots/").Post<TimeSlot, TimeSlot>(data);
        }

        /// <summary>
        /// Update an existing time slot.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<TimeSlot>> Update(string id, TimeSlot data)
        {
             var urlTemplate = "ReferenceData/TimeSlots/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<TimeSlot, TimeSlot>(data);
        }

        /// <summary>
        /// Delete an existing time slot.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/TimeSlots/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class TimeSlotsFacadeBatch
    {
        private IRestClient restClient;

        public TimeSlotsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all time slots. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TimeSlots";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/TimeSlots/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TimeSlotSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/TimeSlots/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a time slot by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TimeSlot";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/TimeSlots/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new time slot.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(TimeSlot data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TimeSlot";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/TimeSlots/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing time slot.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, TimeSlot data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TimeSlot";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/TimeSlots/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing time slot.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/TimeSlots/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class UpgradeCategoriesFacade
    {
        private IRestClient restClient;

        public UpgradeCategoriesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<UpgradeCategories>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/UpgradeCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<UpgradeCategories>();
        }

        /// 
        public async Task<RestResponse<UpgradeCategorySummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/UpgradeCategories/Summary").Get<UpgradeCategorySummaries>();
        }

        /// 
        public async Task<RestResponse<UpgradeCategory>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/UpgradeCategories/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<UpgradeCategory>();
        }

        /// 
        public async Task<RestResponse<UpgradeCategory>> Create(UpgradeCategory data)
        {
            return await restClient.AtUrl("ReferenceData/UpgradeCategories/").Post<UpgradeCategory, UpgradeCategory>(data);
        }

        /// 
        public async Task<RestResponse<UpgradeCategory>> Update(string id, UpgradeCategory data)
        {
             var urlTemplate = "ReferenceData/UpgradeCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<UpgradeCategory, UpgradeCategory>(data);
        }

        /// 
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/UpgradeCategories/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class UpgradeCategoriesFacadeBatch
    {
        private IRestClient restClient;

        public UpgradeCategoriesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.UpgradeCategories";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/UpgradeCategories/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.UpgradeCategorySummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/UpgradeCategories/Summary";

            return bRequest;
        }

        /// 
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.UpgradeCategory";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/UpgradeCategories/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Create(UpgradeCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.UpgradeCategory";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/UpgradeCategories/";

            return bRequest;
        }

        /// 
        public Request Update(string id, UpgradeCategory data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.UpgradeCategory";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/UpgradeCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/UpgradeCategories/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class UserGroupsFacade
    {
        private IRestClient restClient;

        public UserGroupsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<UserGroups>> GetAll(string filter = "null", string maintenanceMode = "null")
        {
            var urlTemplate = "ReferenceData/UserGroups/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<UserGroups>();
        }

        /// 
        public async Task<RestResponse<UserGroupSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/UserGroups/Summary").Get<UserGroupSummaries>();
        }

        /// 
        public async Task<RestResponse<UserGroup>> Get(string id, string filter = "null", string maintenanceMode = "null")
        {
             var urlTemplate = "ReferenceData/UserGroups/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<UserGroup>();
        }

    }
 

 
    /// 
    public class UserGroupsFacadeBatch
    {
        private IRestClient restClient;

        public UserGroupsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(string filter = "null", string maintenanceMode = "null", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.UserGroups";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/UserGroups/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.UserGroupSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/UserGroups/Summary";

            return bRequest;
        }

        /// 
        public Request Get(string id, string filter = "null", string maintenanceMode = "null", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.UserGroup";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/UserGroups/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class WorkerRolesFacade
    {
        private IRestClient restClient;

        public WorkerRolesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all worker roles. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<WorkerRoles>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/WorkerRoles/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<WorkerRoles>();
        }

        /// 
        public async Task<RestResponse<WorkerRoleSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/WorkerRoles/Summary").Get<WorkerRoleSummaries>();
        }

        /// <summary>
        /// Get the details of a worker role by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<WorkerRole>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/WorkerRoles/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<WorkerRole>();
        }

        /// <summary>
        /// Create a new worker role.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<WorkerRole>> Create(WorkerRole data)
        {
            return await restClient.AtUrl("ReferenceData/WorkerRoles/").Post<WorkerRole, WorkerRole>(data);
        }

        /// <summary>
        /// Update an existing worker role.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<WorkerRole>> Update(string id, WorkerRole data)
        {
             var urlTemplate = "ReferenceData/WorkerRoles/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<WorkerRole, WorkerRole>(data);
        }

        /// <summary>
        /// Delete an existing worker role.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/WorkerRoles/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class WorkerRolesFacadeBatch
    {
        private IRestClient restClient;

        public WorkerRolesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all worker roles. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WorkerRoles";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/WorkerRoles/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WorkerRoleSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/WorkerRoles/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a worker role by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WorkerRole";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/WorkerRoles/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new worker role.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(WorkerRole data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WorkerRole";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/WorkerRoles/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing worker role.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, WorkerRole data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WorkerRole";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/WorkerRoles/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing worker role.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/WorkerRoles/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class WorkerTypesFacade
    {
        private IRestClient restClient;

        public WorkerTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all worker types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task<RestResponse<WorkerTypes>> GetAll(string filter = "readwrite", string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/WorkerTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<WorkerTypes>();
        }

        /// 
        public async Task<RestResponse<WorkerTypeSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/WorkerTypes/Summary").Get<WorkerTypeSummaries>();
        }

        /// <summary>
        /// Get the details of a worker type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<WorkerType>> Get(string id, string filter = "readwrite", string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/WorkerTypes/{0}?filter={1}&maintenanceMode={2}";
             urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<WorkerType>();
        }

        /// <summary>
        /// Create a new worker type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<WorkerType>> Create(WorkerType data)
        {
            return await restClient.AtUrl("ReferenceData/WorkerTypes/").Post<WorkerType, WorkerType>(data);
        }

        /// <summary>
        /// Update an existing worker type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<WorkerType>> Update(string id, WorkerType data)
        {
             var urlTemplate = "ReferenceData/WorkerTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<WorkerType, WorkerType>(data);
        }

        /// <summary>
        /// Delete an existing worker type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/WorkerTypes/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class WorkerTypesFacadeBatch
    {
        private IRestClient restClient;

        public WorkerTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all worker types. To get only the resoures for which the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP). For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Request GetAll(string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WorkerTypes";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/WorkerTypes/?filter={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, filter,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WorkerTypeSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/WorkerTypes/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a worker type by id. To get the resource only if the user has write/edit access, pass filter="writeonly". To get the resources in maintenance mode(ignore Control Groups), pass maintenanceMode="true". Maintenance mode requires users to have access to the reference tables. (Specified in TX_REFTABLE_USERGROUP).
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="filter"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string filter = "readwrite", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WorkerType";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/WorkerTypes/{0}?filter={1}&maintenanceMode={2}";
            urlTemplate = string.Format(urlTemplate, id, filter, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new worker type.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(WorkerType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WorkerType";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/WorkerTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing worker type.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, WorkerType data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WorkerType";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/WorkerTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing worker type.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/WorkerTypes/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ZoneGroupsFacade
    {
        private IRestClient restClient;

        public ZoneGroupsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all zone groups. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<ZoneGroups>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "ReferenceData/ZoneGroups/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ZoneGroups>();
        }

        /// 
        public async Task<RestResponse<ZoneGroupSummaries>> GetSummaries()
        {
            return await restClient.AtUrl("ReferenceData/ZoneGroups/Summary").Get<ZoneGroupSummaries>();
        }

        /// <summary>
        /// Get the details of a zone group by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ZoneGroup>> Get(string id, string maintenanceMode = "false")
        {
             var urlTemplate = "ReferenceData/ZoneGroups/{0}?maintenanceMode={1}";
             urlTemplate = string.Format(urlTemplate, id, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<ZoneGroup>();
        }

        /// <summary>
        /// Create a new zone group.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<ZoneGroup>> Create(ZoneGroup data)
        {
            return await restClient.AtUrl("ReferenceData/ZoneGroups/").Post<ZoneGroup, ZoneGroup>(data);
        }

        /// <summary>
        /// Update an existing zone group.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ZoneGroup>> Update(string id, ZoneGroup data)
        {
             var urlTemplate = "ReferenceData/ZoneGroups/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<ZoneGroup, ZoneGroup>(data);
        }

        /// <summary>
        /// Delete an existing zone group.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "ReferenceData/ZoneGroups/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ZoneGroupsFacadeBatch
    {
        private IRestClient restClient;

        public ZoneGroupsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all zone groups. For filtering on specific property value, pass the property name with value as query parameter. If the property is another non primitive object, pass PropertyName.Id and its value as query parameter.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ZoneGroups";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ZoneGroups/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ZoneGroupSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ZoneGroups/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get the details of a zone group by id.
        /// </summary>
        /// <param name="maintenanceMode"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ZoneGroup";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ZoneGroups/{0}?maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, id, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new zone group.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(ZoneGroup data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ZoneGroup";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "ReferenceData/ZoneGroups/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing zone group.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Update(string id, ZoneGroup data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ZoneGroup";
            bRequest.Content = data;

            var urlTemplate = "ReferenceData/ZoneGroups/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing zone group.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "ReferenceData/ZoneGroups/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class AuditLogsFacade
    {
        private IRestClient restClient;

        public AuditLogsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all audit logs. The audit log response is paginated with default pageIndex = 1 and pageSize = 100. To get the audit log between a specific time interval specify auditStartTime and auditEndTime. If only auditStartTime is specified then all audit entries after that time would be returned. If only auditEndTime is specified then all audit entries before that time would be returned.
        /// </summary>
        /// <param name="table"></param>
        /// <param name="action"></param>
        /// <param name="entityIds"></param>
        /// <param name="includeSubEntities"></param>
        /// <param name="auditStartTime"></param>
        /// <param name="auditEndTime"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public async Task<RestResponse<AuditLogResponse>> GetAll(string table = "", string action = "", string entityIds = "", string includeSubEntities = "", string auditStartTime = "", string auditEndTime = "", string pageIndex = "", string pageSize = "")
        {
            var urlTemplate = "Reporting/AuditLogs/?table={0}&action={1}&entityIds={2}&includeSubEntities={3}&auditStartTime={4}&auditEndTime={5}&pageIndex={6}&pageSize={7}";
            urlTemplate = string.Format(urlTemplate, table,action,entityIds,includeSubEntities,auditStartTime,auditEndTime,pageIndex,pageSize);
            return await restClient.AtUrl(urlTemplate).Get<AuditLogResponse>();
        }

        /// <summary>
        /// Get audit log details.
        /// </summary>
        /// <param name="table"></param>
        /// <param name="action"></param>
        /// <param name="entityIds"></param>
        /// <param name="includeSubEntities"></param>
        /// <param name="auditStartTime"></param>
        /// <param name="auditEndTime"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public async Task<RestResponse<AuditEntryDetails>> GetDetails(string table = "", string action = "", string entityIds = "", string includeSubEntities = "", string auditStartTime = "", string auditEndTime = "", string pageIndex = "", string pageSize = "")
        {
            var urlTemplate = "Reporting/AuditLogs/Details/?table={0}&action={1}&entityIds={2}&includeSubEntities={3}&auditStartTime={4}&auditEndTime={5}&pageIndex={6}&pageSize={7}";
            urlTemplate = string.Format(urlTemplate, table,action,entityIds,includeSubEntities,auditStartTime,auditEndTime,pageIndex,pageSize);
            return await restClient.AtUrl(urlTemplate).Get<AuditEntryDetails>();
        }

        /// <summary>
        /// Get details of a audit log.
        /// </summary>
        /// <param name="auditLog"></param>
        /// <returns></returns>
        public async Task<RestResponse<AuditLog>> Get(string auditLog)
        {
             var urlTemplate = "Reporting/AuditLogs/{0}";
             urlTemplate = string.Format(urlTemplate, auditLog);
            return await restClient.AtUrl(urlTemplate).Get<AuditLog>();
        }

    }
 

 
    /// 
    public class AuditLogsFacadeBatch
    {
        private IRestClient restClient;

        public AuditLogsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all audit logs. The audit log response is paginated with default pageIndex = 1 and pageSize = 100. To get the audit log between a specific time interval specify auditStartTime and auditEndTime. If only auditStartTime is specified then all audit entries after that time would be returned. If only auditEndTime is specified then all audit entries before that time would be returned.
        /// </summary>
        /// <param name="table"></param>
        /// <param name="action"></param>
        /// <param name="entityIds"></param>
        /// <param name="includeSubEntities"></param>
        /// <param name="auditStartTime"></param>
        /// <param name="auditEndTime"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public Request GetAll(string table = "", string action = "", string entityIds = "", string includeSubEntities = "", string auditStartTime = "", string auditEndTime = "", string pageIndex = "", string pageSize = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AuditLogResponse";
            bRequest.Content = null;

            var urlTemplate = "Reporting/AuditLogs/?table={0}&action={1}&entityIds={2}&includeSubEntities={3}&auditStartTime={4}&auditEndTime={5}&pageIndex={6}&pageSize={7}";
            urlTemplate = string.Format(urlTemplate, table,action,entityIds,includeSubEntities,auditStartTime,auditEndTime,pageIndex,pageSize);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get audit log details.
        /// </summary>
        /// <param name="table"></param>
        /// <param name="action"></param>
        /// <param name="entityIds"></param>
        /// <param name="includeSubEntities"></param>
        /// <param name="auditStartTime"></param>
        /// <param name="auditEndTime"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public Request GetDetails(string table = "", string action = "", string entityIds = "", string includeSubEntities = "", string auditStartTime = "", string auditEndTime = "", string pageIndex = "", string pageSize = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AuditEntryDetails";
            bRequest.Content = null;

            var urlTemplate = "Reporting/AuditLogs/Details/?table={0}&action={1}&entityIds={2}&includeSubEntities={3}&auditStartTime={4}&auditEndTime={5}&pageIndex={6}&pageSize={7}";
            urlTemplate = string.Format(urlTemplate, table,action,entityIds,includeSubEntities,auditStartTime,auditEndTime,pageIndex,pageSize);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a audit log.
        /// </summary>
        /// <param name="auditLog"></param>
        /// <returns></returns>
        public Request Get(string auditLog, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AuditLog";
            bRequest.Content = null;

            var urlTemplate = "Reporting/AuditLogs/{0}";
            urlTemplate = string.Format(urlTemplate, auditLog);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class OutputSetsFacade
    {
        private IRestClient restClient;

        public OutputSetsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<OutputSets>> GetAll()
        {
            return await restClient.AtUrl("Reporting/OutputSets/").Get<OutputSets>();
        }

        /// 
        public async Task<RestResponse<OutputSet>> Get(string outputSetId)
        {
             var urlTemplate = "Reporting/OutputSets/{0}";
             urlTemplate = string.Format(urlTemplate, outputSetId);
            return await restClient.AtUrl(urlTemplate).Get<OutputSet>();
        }

    }
 

 
    /// 
    public class OutputSetsFacadeBatch
    {
        private IRestClient restClient;

        public OutputSetsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.OutputSets";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "Reporting/OutputSets/";

            return bRequest;
        }

        /// 
        public Request Get(string outputSetId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.OutputSet";
            bRequest.Content = null;

            var urlTemplate = "Reporting/OutputSets/{0}";
            urlTemplate = string.Format(urlTemplate, outputSetId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ReportRequestsFacade
    {
        private IRestClient restClient;

        public ReportRequestsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get a report request.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ReportRequest>> Get(string id = "")
        {
             var urlTemplate = "Reporting/ReportRequests/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Get<ReportRequest>();
        }

        /// <summary>
        /// Get all requests, optionally filtered by active requests only.
        /// </summary>
        /// <param name="activeOnly"></param>
        /// <returns></returns>
        public async Task<RestResponse<ReportRequests>> GetAll(string activeOnly = "")
        {
            var urlTemplate = "Reporting/ReportRequests/?activeOnly={0}";
            urlTemplate = string.Format(urlTemplate, activeOnly);
            return await restClient.AtUrl(urlTemplate).Get<ReportRequests>();
        }

    }
 

 
    /// 
    public class ReportRequestsFacadeBatch
    {
        private IRestClient restClient;

        public ReportRequestsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get a report request.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ReportRequest";
            bRequest.Content = null;

            var urlTemplate = "Reporting/ReportRequests/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get all requests, optionally filtered by active requests only.
        /// </summary>
        /// <param name="activeOnly"></param>
        /// <returns></returns>
        public Request GetAll(string activeOnly = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ReportRequests";
            bRequest.Content = null;

            var urlTemplate = "Reporting/ReportRequests/?activeOnly={0}";
            urlTemplate = string.Format(urlTemplate, activeOnly);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ReportsFacade
    {
        private IRestClient restClient;

        public ReportsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of a report.
        /// </summary>
        /// <param name="reportId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Report>> Get(string reportId = "")
        {
             var urlTemplate = "Reporting/Reports/{0}";
             urlTemplate = string.Format(urlTemplate, reportId);
            return await restClient.AtUrl(urlTemplate).Get<Report>();
        }

        /// <summary>
        /// Get all reports, Optionally filtered by type.
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public async Task<RestResponse<Reports>> GetAll(string type = "")
        {
            var urlTemplate = "Reporting/Reports/?type={0}";
            urlTemplate = string.Format(urlTemplate, type);
            return await restClient.AtUrl(urlTemplate).Get<Reports>();
        }

        /// 
        public async Task<RestResponse<ReportCategories>> GetReportCategories()
        {
            return await restClient.AtUrl("Reporting/Reports/Categories").Get<ReportCategories>();
        }

        /// <summary>
        /// Get report defaults for the specified user group.
        /// </summary>
        /// <param name="userGroup"></param>
        /// <returns></returns>
        public async Task<RestResponse<ReportDefaults>> GetReportDefaults(string userGroup = "")
        {
             var urlTemplate = "Reporting/Reports/Defaults/{0}";
             urlTemplate = string.Format(urlTemplate, userGroup);
            return await restClient.AtUrl(urlTemplate).Get<ReportDefaults>();
        }

        /// <summary>
        /// Get report parameters.
        /// </summary>
        /// <param name="reportId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ReportParameters>> GetReportParameters(string reportId = "")
        {
            var urlTemplate = "Reporting/Reports/Parameters?reportId={0}";
            urlTemplate = string.Format(urlTemplate, reportId);
            return await restClient.AtUrl(urlTemplate).Get<ReportParameters>();
        }

    }
 

 
    /// 
    public class ReportsFacadeBatch
    {
        private IRestClient restClient;

        public ReportsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get details of a report.
        /// </summary>
        /// <param name="reportId"></param>
        /// <returns></returns>
        public Request Get(string reportId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Report";
            bRequest.Content = null;

            var urlTemplate = "Reporting/Reports/{0}";
            urlTemplate = string.Format(urlTemplate, reportId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get all reports, Optionally filtered by type.
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public Request GetAll(string type = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Reports";
            bRequest.Content = null;

            var urlTemplate = "Reporting/Reports/?type={0}";
            urlTemplate = string.Format(urlTemplate, type);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetReportCategories(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ReportCategories";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "Reporting/Reports/Categories";

            return bRequest;
        }

        /// <summary>
        /// Get report defaults for the specified user group.
        /// </summary>
        /// <param name="userGroup"></param>
        /// <returns></returns>
        public Request GetReportDefaults(string userGroup = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ReportDefaults";
            bRequest.Content = null;

            var urlTemplate = "Reporting/Reports/Defaults/{0}";
            urlTemplate = string.Format(urlTemplate, userGroup);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get report parameters.
        /// </summary>
        /// <param name="reportId"></param>
        /// <returns></returns>
        public Request GetReportParameters(string reportId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ReportParameters";
            bRequest.Content = null;

            var urlTemplate = "Reporting/Reports/Parameters?reportId={0}";
            urlTemplate = string.Format(urlTemplate, reportId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class AuthenticateFacade
    {
        private IRestClient restClient;

        public AuthenticateFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<AuthenticationResponse>> Authenticate(AuthenticationRequest authenticationRequest)
        {
            return await restClient.AtUrl("Security/Authenticate/").Post<AuthenticationRequest, AuthenticationResponse>(authenticationRequest);
        }

    }
 

 
    /// 
    public class AuthenticateFacadeBatch
    {
        private IRestClient restClient;

        public AuthenticateFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request Authenticate(AuthenticationRequest authenticationRequest, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AuthenticationResponse";
            bRequest.Content = authenticationRequest;

            bRequest.Uri = restClient.GetBaseUrl() + "Security/Authenticate/";

            return bRequest;
        }

    }
 

 
    /// 
    public class ContextInformationFacade
    {
        private IRestClient restClient;

        public ContextInformationFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<ContextInformation>> Get()
        {
            return await restClient.AtUrl("Security/ContextInformation/").Get<ContextInformation>();
        }

    }
 

 
    /// 
    public class ContextInformationFacadeBatch
    {
        private IRestClient restClient;

        public ContextInformationFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request Get(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ContextInformation";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "Security/ContextInformation/";

            return bRequest;
        }

    }
 

 
    /// 
    public class DivisionsFacade
    {
        private IRestClient restClient;

        public DivisionsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<ControlGroupDivisions>> ControlGroups(string divisionId = "")
        {
             var urlTemplate = "Security/Divisions/{0}/ControlGroups";
             urlTemplate = string.Format(urlTemplate, divisionId);
            return await restClient.AtUrl(urlTemplate).Get<ControlGroupDivisions>();
        }

        /// 
        public async Task<RestResponse<ControlGroupDivisions>> ActiveControlGroups()
        {
            return await restClient.AtUrl("Security/Divisions/ControlGroups").Get<ControlGroupDivisions>();
        }

    }
 

 
    /// 
    public class DivisionsFacadeBatch
    {
        private IRestClient restClient;

        public DivisionsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request ControlGroups(string divisionId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ControlGroupDivisions";
            bRequest.Content = null;

            var urlTemplate = "Security/Divisions/{0}/ControlGroups";
            urlTemplate = string.Format(urlTemplate, divisionId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request ActiveControlGroups(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ControlGroupDivisions";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "Security/Divisions/ControlGroups";

            return bRequest;
        }

    }
 

 
    /// 
    public class ObjectPermissionsFacade
    {
        private IRestClient restClient;

        public ObjectPermissionsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all the object permissions for the provided user group. Optionally filter by constituency id and/or object id.
        /// </summary>
        /// <param name="userGroup"></param>
        /// <param name="constituencyId">Filter object permissions by the specified constituency.</param>
        /// <param name="objectid">Get permissions for a specific object id.</param>
        /// <param name="objectIds">Get permissions for the specified (Comma separated list of objectIds) objects.</param>
        /// <returns></returns>
        public async Task<RestResponse<ObjectPermissions>> Get(string userGroup = "", string constituencyId = "", string objectid = "", string objectIds = "")
        {
            var urlTemplate = "Security/ObjectPermissions/?userGroup={0}&constituencyId={1}&objectid={2}&objectIds={3}";
            urlTemplate = string.Format(urlTemplate, userGroup,constituencyId,objectid,objectIds);
            return await restClient.AtUrl(urlTemplate).Get<ObjectPermissions>();
        }

    }
 

 
    /// 
    public class ObjectPermissionsFacadeBatch
    {
        private IRestClient restClient;

        public ObjectPermissionsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all the object permissions for the provided user group. Optionally filter by constituency id and/or object id.
        /// </summary>
        /// <param name="userGroup"></param>
        /// <param name="constituencyId">Filter object permissions by the specified constituency.</param>
        /// <param name="objectid">Get permissions for a specific object id.</param>
        /// <param name="objectIds">Get permissions for the specified (Comma separated list of objectIds) objects.</param>
        /// <returns></returns>
        public Request Get(string userGroup = "", string constituencyId = "", string objectid = "", string objectIds = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ObjectPermissions";
            bRequest.Content = null;

            var urlTemplate = "Security/ObjectPermissions/?userGroup={0}&constituencyId={1}&objectid={2}&objectIds={3}";
            urlTemplate = string.Format(urlTemplate, userGroup,constituencyId,objectid,objectIds);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ReferenceTableUserGroupsFacade
    {
        private IRestClient restClient;

        public ReferenceTableUserGroupsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all the reference table CRUD rights for the provided user group.
        /// </summary>
        /// <param name="userGroup"></param>
        /// <returns></returns>
        public async Task<RestResponse<ReferenceTableUserGroups>> Get(string userGroup = "")
        {
            var urlTemplate = "Security/ReferenceTableUserGroups/?userGroup={0}";
            urlTemplate = string.Format(urlTemplate, userGroup);
            return await restClient.AtUrl(urlTemplate).Get<ReferenceTableUserGroups>();
        }

    }
 

 
    /// 
    public class ReferenceTableUserGroupsFacadeBatch
    {
        private IRestClient restClient;

        public ReferenceTableUserGroupsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all the reference table CRUD rights for the provided user group.
        /// </summary>
        /// <param name="userGroup"></param>
        /// <returns></returns>
        public Request Get(string userGroup = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ReferenceTableUserGroups";
            bRequest.Content = null;

            var urlTemplate = "Security/ReferenceTableUserGroups/?userGroup={0}";
            urlTemplate = string.Format(urlTemplate, userGroup);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class SecurityUserGroupsFacade
    {
        private IRestClient restClient;

        public SecurityUserGroupsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary></summary>
        /// <param name="userName"></param>
        /// <param name="application">Valid values are tessitura, tablet, onthego</param>
        /// <returns></returns>
        public async Task<RestResponse<UserGroups>> UserGroups(string userName = "", string application = "")
        {
            var urlTemplate = "Security/UserGroups/?userName={0}&application={1}";
            urlTemplate = string.Format(urlTemplate, userName,application);
            return await restClient.AtUrl(urlTemplate).Get<UserGroups>();
        }

        /// 
        public async Task<RestResponse<DefaultUserGroup>> DefaultUserGroup(string userName = "")
        {
            var urlTemplate = "Security/UserGroups/Default?userName={0}";
            urlTemplate = string.Format(urlTemplate, userName);
            return await restClient.AtUrl(urlTemplate).Get<DefaultUserGroup>();
        }

        /// 
        public async Task<RestResponse<UserGroups>> ManagedGroups(string userName = "")
        {
            var urlTemplate = "Security/UserGroups/ManagedGroups?userName={0}";
            urlTemplate = string.Format(urlTemplate, userName);
            return await restClient.AtUrl(urlTemplate).Get<UserGroups>();
        }

        /// 
        public async Task<RestResponse<ControlGroupUserGroups>> ControlGroups(string userGroupId = "")
        {
             var urlTemplate = "Security/UserGroups/{0}/ControlGroups";
             urlTemplate = string.Format(urlTemplate, userGroupId);
            return await restClient.AtUrl(urlTemplate).Get<ControlGroupUserGroups>();
        }

    }
 

 
    /// 
    public class SecurityUserGroupsFacadeBatch
    {
        private IRestClient restClient;

        public SecurityUserGroupsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary></summary>
        /// <param name="userName"></param>
        /// <param name="application">Valid values are tessitura, tablet, onthego</param>
        /// <returns></returns>
        public Request UserGroups(string userName = "", string application = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.UserGroups";
            bRequest.Content = null;

            var urlTemplate = "Security/UserGroups/?userName={0}&application={1}";
            urlTemplate = string.Format(urlTemplate, userName,application);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request DefaultUserGroup(string userName = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.DefaultUserGroup";
            bRequest.Content = null;

            var urlTemplate = "Security/UserGroups/Default?userName={0}";
            urlTemplate = string.Format(urlTemplate, userName);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request ManagedGroups(string userName = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.UserGroups";
            bRequest.Content = null;

            var urlTemplate = "Security/UserGroups/ManagedGroups?userName={0}";
            urlTemplate = string.Format(urlTemplate, userName);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request ControlGroups(string userGroupId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ControlGroupUserGroups";
            bRequest.Content = null;

            var urlTemplate = "Security/UserGroups/{0}/ControlGroups";
            urlTemplate = string.Format(urlTemplate, userGroupId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class UserPreferencesFacade
    {
        private IRestClient restClient;

        public UserPreferencesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<UserPreference>> Get(string key)
        {
             var urlTemplate = "Security/UserPreferences/{0}";
             urlTemplate = string.Format(urlTemplate, key);
            return await restClient.AtUrl(urlTemplate).Get<UserPreference>();
        }

        /// 
        public async Task<RestResponse<UserPreferences>> GetAll()
        {
            return await restClient.AtUrl("Security/UserPreferences/").Get<UserPreferences>();
        }

        /// 
        public async Task<RestResponse<UserPreference>> Create(UserPreference userPreference)
        {
            return await restClient.AtUrl("Security/UserPreferences/").Post<UserPreference, UserPreference>(userPreference);
        }

        /// 
        public async Task<RestResponse<UserPreference>> Update(string id, UserPreference userPreference)
        {
             var urlTemplate = "Security/UserPreferences/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<UserPreference, UserPreference>(userPreference);
        }

    }
 

 
    /// 
    public class UserPreferencesFacadeBatch
    {
        private IRestClient restClient;

        public UserPreferencesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request Get(string key, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.UserPreference";
            bRequest.Content = null;

            var urlTemplate = "Security/UserPreferences/{0}";
            urlTemplate = string.Format(urlTemplate, key);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetAll(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.UserPreferences";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "Security/UserPreferences/";

            return bRequest;
        }

        /// 
        public Request Create(UserPreference userPreference, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.UserPreference";
            bRequest.Content = userPreference;

            bRequest.Uri = restClient.GetBaseUrl() + "Security/UserPreferences/";

            return bRequest;
        }

        /// 
        public Request Update(string id, UserPreference userPreference, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.UserPreference";
            bRequest.Content = userPreference;

            var urlTemplate = "Security/UserPreferences/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class UsersFacade
    {
        private IRestClient restClient;

        public UsersFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<User>> User(string userName = "")
        {
             var urlTemplate = "Security/Users/{0}";
             urlTemplate = string.Format(urlTemplate, userName);
            return await restClient.AtUrl(urlTemplate).Get<User>();
        }

    }
 

 
    /// 
    public class UsersFacadeBatch
    {
        private IRestClient restClient;

        public UsersFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request User(string userName = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.User";
            bRequest.Content = null;

            var urlTemplate = "Security/Users/{0}";
            urlTemplate = string.Format(urlTemplate, userName);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ValidateWebLoginFacade
    {
        private IRestClient restClient;

        public ValidateWebLoginFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<WebLoginValidationResponse>> Create(WebLoginValidationRequest validationRequest)
        {
            return await restClient.AtUrl("Security/ValidateWebLogin/").Post<WebLoginValidationRequest, WebLoginValidationResponse>(validationRequest);
        }

    }
 

 
    /// 
    public class ValidateWebLoginFacadeBatch
    {
        private IRestClient restClient;

        public ValidateWebLoginFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request Create(WebLoginValidationRequest validationRequest, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WebLoginValidationResponse";
            bRequest.Content = validationRequest;

            bRequest.Uri = restClient.GetBaseUrl() + "Security/ValidateWebLogin/";

            return bRequest;
        }

    }
 

 
    /// 
    public class ArtistsFacade
    {
        private IRestClient restClient;

        public ArtistsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<Artists>> GetAll()
        {
            return await restClient.AtUrl("TXN/Artists/").Get<Artists>();
        }

        /// <summary>
        /// Get details of an existing artist.
        /// </summary>
        /// <param name="artistId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Artist>> Get(string artistId = "")
        {
             var urlTemplate = "TXN/Artists/{0}";
             urlTemplate = string.Format(urlTemplate, artistId);
            return await restClient.AtUrl(urlTemplate).Get<Artist>();
        }

        /// <summary>
        /// Create a new artist.
        /// </summary>
        /// <param name="artist"></param>
        /// <returns></returns>
        public async Task<RestResponse<Artist>> Create(Artist artist)
        {
            return await restClient.AtUrl("TXN/Artists/").Post<Artist, Artist>(artist);
        }

        /// <summary>
        /// Update an existing artist.
        /// </summary>
        /// <param name="artistId"></param>
        /// <param name="artist"></param>
        /// <returns></returns>
        public async Task<RestResponse<Artist>> Update(string artistId, Artist artist)
        {
             var urlTemplate = "TXN/Artists/{0}";
             urlTemplate = string.Format(urlTemplate, artistId);
            return await restClient.AtUrl(urlTemplate).Put<Artist, Artist>(artist);
        }

        /// <summary>
        /// Delete an existing artist.
        /// </summary>
        /// <param name="artistId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string artistId)
        {
             var urlTemplate = "TXN/Artists/{0}";
             urlTemplate = string.Format(urlTemplate, artistId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ArtistsFacadeBatch
    {
        private IRestClient restClient;

        public ArtistsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Artists";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/Artists/";

            return bRequest;
        }

        /// <summary>
        /// Get details of an existing artist.
        /// </summary>
        /// <param name="artistId"></param>
        /// <returns></returns>
        public Request Get(string artistId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Artist";
            bRequest.Content = null;

            var urlTemplate = "TXN/Artists/{0}";
            urlTemplate = string.Format(urlTemplate, artistId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new artist.
        /// </summary>
        /// <param name="artist"></param>
        /// <returns></returns>
        public Request Create(Artist artist, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Artist";
            bRequest.Content = artist;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/Artists/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing artist.
        /// </summary>
        /// <param name="artistId"></param>
        /// <param name="artist"></param>
        /// <returns></returns>
        public Request Update(string artistId, Artist artist, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Artist";
            bRequest.Content = artist;

            var urlTemplate = "TXN/Artists/{0}";
            urlTemplate = string.Format(urlTemplate, artistId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing artist.
        /// </summary>
        /// <param name="artistId"></param>
        public Request Delete(string artistId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/Artists/{0}";
            urlTemplate = string.Format(urlTemplate, artistId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class BulkCopySetsFacade
    {
        private IRestClient restClient;

        public BulkCopySetsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<BulkCopySets>> GetAll()
        {
            return await restClient.AtUrl("Txn/BulkCopySets/").Get<BulkCopySets>();
        }

        /// 
        public async Task<RestResponse<BulkCopySetSummaries>> GetAllSummaries()
        {
            return await restClient.AtUrl("Txn/BulkCopySets/Summary").Get<BulkCopySetSummaries>();
        }

        /// <summary>
        /// Get a bulk copy set by Id.
        /// </summary>
        /// <param name="bulkCopySetId"></param>
        /// <returns></returns>
        public async Task<RestResponse<BulkCopySet>> Get(string bulkCopySetId)
        {
             var urlTemplate = "Txn/BulkCopySets/{0}";
             urlTemplate = string.Format(urlTemplate, bulkCopySetId);
            return await restClient.AtUrl(urlTemplate).Get<BulkCopySet>();
        }

        /// <summary>
        /// Creates a new bulk copy set.
        /// </summary>
        /// <param name="bulkCopySet"></param>
        /// <returns></returns>
        public async Task<RestResponse<BulkCopySet>> Create(BulkCopySet bulkCopySet)
        {
            return await restClient.AtUrl("Txn/BulkCopySets/").Post<BulkCopySet, BulkCopySet>(bulkCopySet);
        }

        /// <summary>
        /// Updates an existing bulk copy set.
        /// </summary>
        /// <param name="bulkCopySetId"></param>
        /// <param name="bulkCopySet"></param>
        /// <returns></returns>
        public async Task<RestResponse<BulkCopySet>> Update(string bulkCopySetId, BulkCopySet bulkCopySet)
        {
             var urlTemplate = "Txn/BulkCopySets/{0}";
             urlTemplate = string.Format(urlTemplate, bulkCopySetId);
            return await restClient.AtUrl(urlTemplate).Put<BulkCopySet, BulkCopySet>(bulkCopySet);
        }

        /// <summary>
        /// Deletes an existing bulk copy set.
        /// </summary>
        /// <param name="bulkCopySetId"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Delete(string bulkCopySetId)
        {
             var urlTemplate = "Txn/BulkCopySets/{0}";
             urlTemplate = string.Format(urlTemplate, bulkCopySetId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class BulkCopySetsFacadeBatch
    {
        private IRestClient restClient;

        public BulkCopySetsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BulkCopySets";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "Txn/BulkCopySets/";

            return bRequest;
        }

        /// 
        public Request GetAllSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BulkCopySetSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "Txn/BulkCopySets/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get a bulk copy set by Id.
        /// </summary>
        /// <param name="bulkCopySetId"></param>
        /// <returns></returns>
        public Request Get(string bulkCopySetId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BulkCopySet";
            bRequest.Content = null;

            var urlTemplate = "Txn/BulkCopySets/{0}";
            urlTemplate = string.Format(urlTemplate, bulkCopySetId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Creates a new bulk copy set.
        /// </summary>
        /// <param name="bulkCopySet"></param>
        /// <returns></returns>
        public Request Create(BulkCopySet bulkCopySet, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BulkCopySet";
            bRequest.Content = bulkCopySet;

            bRequest.Uri = restClient.GetBaseUrl() + "Txn/BulkCopySets/";

            return bRequest;
        }

        /// <summary>
        /// Updates an existing bulk copy set.
        /// </summary>
        /// <param name="bulkCopySetId"></param>
        /// <param name="bulkCopySet"></param>
        /// <returns></returns>
        public Request Update(string bulkCopySetId, BulkCopySet bulkCopySet, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BulkCopySet";
            bRequest.Content = bulkCopySet;

            var urlTemplate = "Txn/BulkCopySets/{0}";
            urlTemplate = string.Format(urlTemplate, bulkCopySetId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Deletes an existing bulk copy set.
        /// </summary>
        /// <param name="bulkCopySetId"></param>
        /// <returns></returns>
        public Request Delete(string bulkCopySetId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Txn/BulkCopySets/{0}";
            urlTemplate = string.Format(urlTemplate, bulkCopySetId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class BulkDailyCopyExclusionsFacade
    {
        private IRestClient restClient;

        public BulkDailyCopyExclusionsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<BulkDailyCopyExclusions>> GetAll(string bulkCopySetId = "")
        {
            var urlTemplate = "Txn/BulkDailyCopyExclusions/?bulkCopySetId={0}";
            urlTemplate = string.Format(urlTemplate, bulkCopySetId);
            return await restClient.AtUrl(urlTemplate).Get<BulkDailyCopyExclusions>();
        }

        /// 
        public async Task<RestResponse<BulkDailyCopyExclusion>> Get(string bulkDailyCopyExclusionId)
        {
             var urlTemplate = "Txn/BulkDailyCopyExclusions/{0}";
             urlTemplate = string.Format(urlTemplate, bulkDailyCopyExclusionId);
            return await restClient.AtUrl(urlTemplate).Get<BulkDailyCopyExclusion>();
        }

        /// 
        public async Task<RestResponse<BulkDailyCopyExclusion>> Create(BulkDailyCopyExclusion bulkDailyCopyExclusion)
        {
            return await restClient.AtUrl("Txn/BulkDailyCopyExclusions/").Post<BulkDailyCopyExclusion, BulkDailyCopyExclusion>(bulkDailyCopyExclusion);
        }

        /// 
        public async Task<RestResponse<BulkDailyCopyExclusion>> Update(string bulkDailyCopyExclusionId, BulkDailyCopyExclusion bulkDailyCopyExclusion)
        {
             var urlTemplate = "Txn/BulkDailyCopyExclusions/{0}";
             urlTemplate = string.Format(urlTemplate, bulkDailyCopyExclusionId);
            return await restClient.AtUrl(urlTemplate).Put<BulkDailyCopyExclusion, BulkDailyCopyExclusion>(bulkDailyCopyExclusion);
        }

        /// 
        public async Task<RestResponse<NoResponse>> Delete(string bulkDailyCopyExclusionId)
        {
             var urlTemplate = "Txn/BulkDailyCopyExclusions/{0}";
             urlTemplate = string.Format(urlTemplate, bulkDailyCopyExclusionId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class BulkDailyCopyExclusionsFacadeBatch
    {
        private IRestClient restClient;

        public BulkDailyCopyExclusionsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(string bulkCopySetId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BulkDailyCopyExclusions";
            bRequest.Content = null;

            var urlTemplate = "Txn/BulkDailyCopyExclusions/?bulkCopySetId={0}";
            urlTemplate = string.Format(urlTemplate, bulkCopySetId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Get(string bulkDailyCopyExclusionId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BulkDailyCopyExclusion";
            bRequest.Content = null;

            var urlTemplate = "Txn/BulkDailyCopyExclusions/{0}";
            urlTemplate = string.Format(urlTemplate, bulkDailyCopyExclusionId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Create(BulkDailyCopyExclusion bulkDailyCopyExclusion, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BulkDailyCopyExclusion";
            bRequest.Content = bulkDailyCopyExclusion;

            bRequest.Uri = restClient.GetBaseUrl() + "Txn/BulkDailyCopyExclusions/";

            return bRequest;
        }

        /// 
        public Request Update(string bulkDailyCopyExclusionId, BulkDailyCopyExclusion bulkDailyCopyExclusion, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.BulkDailyCopyExclusion";
            bRequest.Content = bulkDailyCopyExclusion;

            var urlTemplate = "Txn/BulkDailyCopyExclusions/{0}";
            urlTemplate = string.Format(urlTemplate, bulkDailyCopyExclusionId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Delete(string bulkDailyCopyExclusionId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Txn/BulkDailyCopyExclusions/{0}";
            urlTemplate = string.Format(urlTemplate, bulkDailyCopyExclusionId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ContributionFacade
    {
        private IRestClient restClient;

        public ContributionFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<Contribution>> Create(Contribution contribution)
        {
            return await restClient.AtUrl("TXN/Contributions/").Post<Contribution, Contribution>(contribution);
        }

        /// 
        public async Task<RestResponse<Contribution>> Update(string contributionId, Contribution contribution)
        {
             var urlTemplate = "TXN/Contributions/{0}";
             urlTemplate = string.Format(urlTemplate, contributionId);
            return await restClient.AtUrl(urlTemplate).Put<Contribution, Contribution>(contribution);
        }

    }
 

 
    /// 
    public class ContributionFacadeBatch
    {
        private IRestClient restClient;

        public ContributionFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request Create(Contribution contribution, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Contribution";
            bRequest.Content = contribution;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/Contributions/";

            return bRequest;
        }

        /// 
        public Request Update(string contributionId, Contribution contribution, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Contribution";
            bRequest.Content = contribution;

            var urlTemplate = "TXN/Contributions/{0}";
            urlTemplate = string.Format(urlTemplate, contributionId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class CreditsFacade
    {
        private IRestClient restClient;

        public CreditsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Returns all credits for the requested production element, and all credits from above it in the production hierarchy.
        /// </summary>
        /// <param name="productionElementIds">A comma separated list of IDs of production elements (i.e. performances, production-seasons, productions, titles)</param>
        public async Task<RestResponse<CreditResults>> GetCredits(string productionElementIds = "null")
        {
            var urlTemplate = "TXN/Credits/?productionElementIds={0}";
            urlTemplate = string.Format(urlTemplate, productionElementIds);
            return await restClient.AtUrl(urlTemplate).Get<CreditResults>();
        }

    }
 

 
    /// 
    public class CreditsFacadeBatch
    {
        private IRestClient restClient;

        public CreditsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Returns all credits for the requested production element, and all credits from above it in the production hierarchy.
        /// </summary>
        /// <param name="productionElementIds">A comma separated list of IDs of production elements (i.e. performances, production-seasons, productions, titles)</param>
        public Request GetCredits(string productionElementIds = "null", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CreditResults";
            bRequest.Content = null;

            var urlTemplate = "TXN/Credits/?productionElementIds={0}";
            urlTemplate = string.Format(urlTemplate, productionElementIds);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class EmailResponsesFacade
    {
        private IRestClient restClient;

        public EmailResponsesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Updates an appeal with customer data in response to an email event. EventName should be one of open, click, hard-bounce, soft-bounce or opt-out.
        /// </summary>
        /// <param name="request"></param>
        public async Task<RestResponse<NoResponse>> UpdateAppeal(EmailPromotionUpdateRequest request)
        {
            return await restClient.AtUrl("TXN/EmailResponses/").Post<EmailPromotionUpdateRequest, NoResponse>(request);
        }

    }
 

 
    /// 
    public class EmailResponsesFacadeBatch
    {
        private IRestClient restClient;

        public EmailResponsesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Updates an appeal with customer data in response to an email event. EventName should be one of open, click, hard-bounce, soft-bounce or opt-out.
        /// </summary>
        /// <param name="request"></param>
        public Request UpdateAppeal(EmailPromotionUpdateRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = request;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/EmailResponses/";

            return bRequest;
        }

    }
 

 
    /// 
    public class FacilitiesFacade
    {
        private IRestClient restClient;

        public FacilitiesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<Facilities>> GetAll()
        {
            return await restClient.AtUrl("TXN/Facilities/").Get<Facilities>();
        }

        /// 
        public async Task<RestResponse<FacilitySummaries>> GetSummaries()
        {
            return await restClient.AtUrl("TXN/Facilities/Summary").Get<FacilitySummaries>();
        }

        /// <summary>
        /// Get details of a Facility.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Facility>> Get(string id = "")
        {
             var urlTemplate = "TXN/Facilities/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Get<Facility>();
        }

        /// <summary>
        /// Create a new Facility.
        /// </summary>
        /// <param name="facility"></param>
        /// <returns></returns>
        public async Task<RestResponse<Facility>> Create(Facility facility)
        {
            return await restClient.AtUrl("TXN/Facilities/").Post<Facility, Facility>(facility);
        }

        /// <summary>
        /// Update a Facility.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="facility"></param>
        /// <returns></returns>
        public async Task<RestResponse<Facility>> Update(string id, Facility facility)
        {
             var urlTemplate = "TXN/Facilities/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<Facility, Facility>(facility);
        }

        /// <summary>
        /// Delete a Facility.
        /// </summary>
        /// <param name="id"></param>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "TXN/Facilities/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class FacilitiesFacadeBatch
    {
        private IRestClient restClient;

        public FacilitiesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Facilities";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/Facilities/";

            return bRequest;
        }

        /// 
        public Request GetSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.FacilitySummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/Facilities/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get details of a Facility.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Facility";
            bRequest.Content = null;

            var urlTemplate = "TXN/Facilities/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new Facility.
        /// </summary>
        /// <param name="facility"></param>
        /// <returns></returns>
        public Request Create(Facility facility, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Facility";
            bRequest.Content = facility;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/Facilities/";

            return bRequest;
        }

        /// <summary>
        /// Update a Facility.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="facility"></param>
        /// <returns></returns>
        public Request Update(string id, Facility facility, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Facility";
            bRequest.Content = facility;

            var urlTemplate = "TXN/Facilities/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete a Facility.
        /// </summary>
        /// <param name="id"></param>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/Facilities/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class FeesFacade
    {
        private IRestClient restClient;

        public FeesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all fees.
        /// </summary>
        /// <param name="seasonId"></param>
        /// <param name="userDefined"></param>
        /// <returns></returns>
        public async Task<RestResponse<Fees>> GetAll(string seasonId = "", string userDefined = "")
        {
            var urlTemplate = "TXN/Fees/?seasonId={0}&userDefined={1}";
            urlTemplate = string.Format(urlTemplate, seasonId,userDefined);
            return await restClient.AtUrl(urlTemplate).Get<Fees>();
        }

        /// <summary>
        /// Get summary representation of all fees.
        /// </summary>
        /// <param name="seasonId"></param>
        /// <param name="userDefined"></param>
        /// <returns></returns>
        public async Task<RestResponse<FeeSummaries>> GetSummaries(string seasonId = "", string userDefined = "")
        {
            var urlTemplate = "TXN/Fees/Summary/?seasonId={0}&userDefined={1}";
            urlTemplate = string.Format(urlTemplate, seasonId,userDefined);
            return await restClient.AtUrl(urlTemplate).Get<FeeSummaries>();
        }

        /// <summary>
        /// Get details of a fee.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Fee>> Get(string id = "")
        {
             var urlTemplate = "TXN/Fees/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Get<Fee>();
        }

    }
 

 
    /// 
    public class FeesFacadeBatch
    {
        private IRestClient restClient;

        public FeesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all fees.
        /// </summary>
        /// <param name="seasonId"></param>
        /// <param name="userDefined"></param>
        /// <returns></returns>
        public Request GetAll(string seasonId = "", string userDefined = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Fees";
            bRequest.Content = null;

            var urlTemplate = "TXN/Fees/?seasonId={0}&userDefined={1}";
            urlTemplate = string.Format(urlTemplate, seasonId,userDefined);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get summary representation of all fees.
        /// </summary>
        /// <param name="seasonId"></param>
        /// <param name="userDefined"></param>
        /// <returns></returns>
        public Request GetSummaries(string seasonId = "", string userDefined = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.FeeSummaries";
            bRequest.Content = null;

            var urlTemplate = "TXN/Fees/Summary/?seasonId={0}&userDefined={1}";
            urlTemplate = string.Format(urlTemplate, seasonId,userDefined);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a fee.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Fee";
            bRequest.Content = null;

            var urlTemplate = "TXN/Fees/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class HoldCodesFacade
    {
        private IRestClient restClient;

        public HoldCodesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<HoldCodes>> GetAll()
        {
            return await restClient.AtUrl("TXN/HoldCodes/").Get<HoldCodes>();
        }

        /// 
        public async Task<RestResponse<HoldCode>> Get(string holdCodeId)
        {
             var urlTemplate = "TXN/HoldCodes/{0}";
             urlTemplate = string.Format(urlTemplate, holdCodeId);
            return await restClient.AtUrl(urlTemplate).Get<HoldCode>();
        }

        /// 
        public async Task<RestResponse<HoldCode>> Create(HoldCode holdCode)
        {
            return await restClient.AtUrl("TXN/HoldCodes/").Post<HoldCode, HoldCode>(holdCode);
        }

        /// 
        public async Task<RestResponse<HoldCode>> Update(string holdCodeId, HoldCode holdCode)
        {
             var urlTemplate = "TXN/HoldCodes/{0}";
             urlTemplate = string.Format(urlTemplate, holdCodeId);
            return await restClient.AtUrl(urlTemplate).Put<HoldCode, HoldCode>(holdCode);
        }

        /// 
        public async Task<RestResponse<NoResponse>> Delete(string holdCodeId)
        {
             var urlTemplate = "TXN/HoldCodes/{0}";
             urlTemplate = string.Format(urlTemplate, holdCodeId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class HoldCodesFacadeBatch
    {
        private IRestClient restClient;

        public HoldCodesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.HoldCodes";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/HoldCodes/";

            return bRequest;
        }

        /// 
        public Request Get(string holdCodeId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.HoldCode";
            bRequest.Content = null;

            var urlTemplate = "TXN/HoldCodes/{0}";
            urlTemplate = string.Format(urlTemplate, holdCodeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Create(HoldCode holdCode, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.HoldCode";
            bRequest.Content = holdCode;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/HoldCodes/";

            return bRequest;
        }

        /// 
        public Request Update(string holdCodeId, HoldCode holdCode, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.HoldCode";
            bRequest.Content = holdCode;

            var urlTemplate = "TXN/HoldCodes/{0}";
            urlTemplate = string.Format(urlTemplate, holdCodeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request Delete(string holdCodeId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/HoldCodes/{0}";
            urlTemplate = string.Format(urlTemplate, holdCodeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class HoldCodeUserGroupsFacade
    {
        private IRestClient restClient;

        public HoldCodeUserGroupsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all HoldCodeUserGroups.  Optional filter for a UserGroup or HoldCode.
        /// </summary>
        /// <param name="userGroup"></param>
        /// <param name="holdCode"></param>
        /// <returns></returns>
        public async Task<RestResponse<HoldCodeUserGroups>> GetAll(string userGroup = "null", string holdCode = "null")
        {
            var urlTemplate = "Txn/HoldCodeUserGroups/?userGroup={0}&holdCode={1}";
            urlTemplate = string.Format(urlTemplate, userGroup,holdCode);
            return await restClient.AtUrl(urlTemplate).Get<HoldCodeUserGroups>();
        }

        /// <summary>
        /// Get details of a hold code user group.
        /// </summary>
        /// <param name="holdCodeUserGroupId"></param>
        /// <returns></returns>
        public async Task<RestResponse<HoldCodeUserGroup>> Get(string holdCodeUserGroupId)
        {
             var urlTemplate = "Txn/HoldCodeUserGroups/{0}";
             urlTemplate = string.Format(urlTemplate, holdCodeUserGroupId);
            return await restClient.AtUrl(urlTemplate).Get<HoldCodeUserGroup>();
        }

        /// <summary>
        /// Get all HoldCodeUserGroups in Summary.  Optional filter for a UserGroup or HoldCode.
        /// </summary>
        /// <param name="userGroup"></param>
        /// <param name="holdCode"></param>
        /// <returns></returns>
        public async Task<RestResponse<HoldCodeUserGroupSummaries>> GetAllSummaries(string userGroup = "null", string holdCode = "null")
        {
            var urlTemplate = "Txn/HoldCodeUserGroups/Summary?userGroup={0}&holdCode={1}";
            urlTemplate = string.Format(urlTemplate, userGroup,holdCode);
            return await restClient.AtUrl(urlTemplate).Get<HoldCodeUserGroupSummaries>();
        }

        /// <summary>
        /// Get summary version of a hold code user group.
        /// </summary>
        /// <param name="holdCodeUserGroupId"></param>
        /// <returns></returns>
        public async Task<RestResponse<HoldCodeUserGroupSummary>> GetSummary(string holdCodeUserGroupId)
        {
             var urlTemplate = "Txn/HoldCodeUserGroups/Summary/{0}";
             urlTemplate = string.Format(urlTemplate, holdCodeUserGroupId);
            return await restClient.AtUrl(urlTemplate).Get<HoldCodeUserGroupSummary>();
        }

        /// <summary>
        /// Create a new hold code user group.
        /// </summary>
        /// <param name="holdCodeUserGroup"></param>
        /// <returns></returns>
        public async Task<RestResponse<HoldCodeUserGroup>> Create(HoldCodeUserGroup holdCodeUserGroup)
        {
            return await restClient.AtUrl("Txn/HoldCodeUserGroups/").Post<HoldCodeUserGroup, HoldCodeUserGroup>(holdCodeUserGroup);
        }

        /// <summary>
        /// Update an existing hold code user group.
        /// </summary>
        /// <param name="holdCodeUserGroupId"></param>
        /// <param name="holdCodeUserGroup"></param>
        /// <returns></returns>
        public async Task<RestResponse<HoldCodeUserGroup>> Update(string holdCodeUserGroupId, HoldCodeUserGroup holdCodeUserGroup)
        {
             var urlTemplate = "Txn/HoldCodeUserGroups/{0}";
             urlTemplate = string.Format(urlTemplate, holdCodeUserGroupId);
            return await restClient.AtUrl(urlTemplate).Put<HoldCodeUserGroup, HoldCodeUserGroup>(holdCodeUserGroup);
        }

        /// <summary>
        /// Delete an existing hold code user group.
        /// </summary>
        /// <param name="holdCodeUserGroupId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string holdCodeUserGroupId)
        {
             var urlTemplate = "Txn/HoldCodeUserGroups/{0}";
             urlTemplate = string.Format(urlTemplate, holdCodeUserGroupId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class HoldCodeUserGroupsFacadeBatch
    {
        private IRestClient restClient;

        public HoldCodeUserGroupsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all HoldCodeUserGroups.  Optional filter for a UserGroup or HoldCode.
        /// </summary>
        /// <param name="userGroup"></param>
        /// <param name="holdCode"></param>
        /// <returns></returns>
        public Request GetAll(string userGroup = "null", string holdCode = "null", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.HoldCodeUserGroups";
            bRequest.Content = null;

            var urlTemplate = "Txn/HoldCodeUserGroups/?userGroup={0}&holdCode={1}";
            urlTemplate = string.Format(urlTemplate, userGroup,holdCode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a hold code user group.
        /// </summary>
        /// <param name="holdCodeUserGroupId"></param>
        /// <returns></returns>
        public Request Get(string holdCodeUserGroupId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.HoldCodeUserGroup";
            bRequest.Content = null;

            var urlTemplate = "Txn/HoldCodeUserGroups/{0}";
            urlTemplate = string.Format(urlTemplate, holdCodeUserGroupId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get all HoldCodeUserGroups in Summary.  Optional filter for a UserGroup or HoldCode.
        /// </summary>
        /// <param name="userGroup"></param>
        /// <param name="holdCode"></param>
        /// <returns></returns>
        public Request GetAllSummaries(string userGroup = "null", string holdCode = "null", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.HoldCodeUserGroupSummaries";
            bRequest.Content = null;

            var urlTemplate = "Txn/HoldCodeUserGroups/Summary?userGroup={0}&holdCode={1}";
            urlTemplate = string.Format(urlTemplate, userGroup,holdCode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get summary version of a hold code user group.
        /// </summary>
        /// <param name="holdCodeUserGroupId"></param>
        /// <returns></returns>
        public Request GetSummary(string holdCodeUserGroupId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.HoldCodeUserGroupSummary";
            bRequest.Content = null;

            var urlTemplate = "Txn/HoldCodeUserGroups/Summary/{0}";
            urlTemplate = string.Format(urlTemplate, holdCodeUserGroupId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new hold code user group.
        /// </summary>
        /// <param name="holdCodeUserGroup"></param>
        /// <returns></returns>
        public Request Create(HoldCodeUserGroup holdCodeUserGroup, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.HoldCodeUserGroup";
            bRequest.Content = holdCodeUserGroup;

            bRequest.Uri = restClient.GetBaseUrl() + "Txn/HoldCodeUserGroups/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing hold code user group.
        /// </summary>
        /// <param name="holdCodeUserGroupId"></param>
        /// <param name="holdCodeUserGroup"></param>
        /// <returns></returns>
        public Request Update(string holdCodeUserGroupId, HoldCodeUserGroup holdCodeUserGroup, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.HoldCodeUserGroup";
            bRequest.Content = holdCodeUserGroup;

            var urlTemplate = "Txn/HoldCodeUserGroups/{0}";
            urlTemplate = string.Format(urlTemplate, holdCodeUserGroupId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing hold code user group.
        /// </summary>
        /// <param name="holdCodeUserGroupId"></param>
        public Request Delete(string holdCodeUserGroupId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Txn/HoldCodeUserGroups/{0}";
            urlTemplate = string.Format(urlTemplate, holdCodeUserGroupId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class InvoiceBillingFacade
    {
        private IRestClient restClient;

        public InvoiceBillingFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Invoice billing
        /// </summary>
        /// <param name="invoiceBillingRequest"></param>
        /// <returns></returns>
        public async Task<RestResponse<InvoiceBillingResponses>> BillInvoices(InvoiceBillingRequest invoiceBillingRequest)
        {
            return await restClient.AtUrl("TXN/InvoiceBilling/").Post<InvoiceBillingRequest, InvoiceBillingResponses>(invoiceBillingRequest);
        }

    }
 

 
    /// 
    public class InvoiceBillingFacadeBatch
    {
        private IRestClient restClient;

        public InvoiceBillingFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Invoice billing
        /// </summary>
        /// <param name="invoiceBillingRequest"></param>
        /// <returns></returns>
        public Request BillInvoices(InvoiceBillingRequest invoiceBillingRequest, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.InvoiceBillingResponses";
            bRequest.Content = invoiceBillingRequest;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/InvoiceBilling/";

            return bRequest;
        }

    }
 

 
    /// 
    public class ModeOfSaleCategoriesFacade
    {
        private IRestClient restClient;

        public ModeOfSaleCategoriesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<ModeOfSaleCategories>> GetAll()
        {
            return await restClient.AtUrl("TXN/ModeOfSaleCategories/").Get<ModeOfSaleCategories>();
        }

        /// <summary>
        /// Get details of a mode of sale category.
        /// </summary>
        /// <param name="modeOfSaleCategoryId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ModeOfSaleCategory>> Get(string modeOfSaleCategoryId = "")
        {
             var urlTemplate = "TXN/ModeOfSaleCategories/{0}";
             urlTemplate = string.Format(urlTemplate, modeOfSaleCategoryId);
            return await restClient.AtUrl(urlTemplate).Get<ModeOfSaleCategory>();
        }

        /// <summary>
        /// Create a new mode of sale category.
        /// </summary>
        /// <param name="modeOfSaleCategory"></param>
        /// <returns></returns>
        public async Task<RestResponse<ModeOfSaleCategory>> Create(ModeOfSaleCategory modeOfSaleCategory)
        {
            return await restClient.AtUrl("TXN/ModeOfSaleCategories/").Post<ModeOfSaleCategory, ModeOfSaleCategory>(modeOfSaleCategory);
        }

        /// <summary>
        /// Update an existing mode of sale category.
        /// </summary>
        /// <param name="modeOfSaleCategoryId"></param>
        /// <param name="modeOfSaleCategory"></param>
        /// <returns></returns>
        public async Task<RestResponse<ModeOfSaleCategory>> Update(string modeOfSaleCategoryId, ModeOfSaleCategory modeOfSaleCategory)
        {
             var urlTemplate = "TXN/ModeOfSaleCategories/{0}";
             urlTemplate = string.Format(urlTemplate, modeOfSaleCategoryId);
            return await restClient.AtUrl(urlTemplate).Put<ModeOfSaleCategory, ModeOfSaleCategory>(modeOfSaleCategory);
        }

        /// <summary>
        /// Delete an existing mode of sale category.
        /// </summary>
        /// <param name="modeOfSaleCategoryId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string modeOfSaleCategoryId)
        {
             var urlTemplate = "TXN/ModeOfSaleCategories/{0}";
             urlTemplate = string.Format(urlTemplate, modeOfSaleCategoryId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ModeOfSaleCategoriesFacadeBatch
    {
        private IRestClient restClient;

        public ModeOfSaleCategoriesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ModeOfSaleCategories";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/ModeOfSaleCategories/";

            return bRequest;
        }

        /// <summary>
        /// Get details of a mode of sale category.
        /// </summary>
        /// <param name="modeOfSaleCategoryId"></param>
        /// <returns></returns>
        public Request Get(string modeOfSaleCategoryId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ModeOfSaleCategory";
            bRequest.Content = null;

            var urlTemplate = "TXN/ModeOfSaleCategories/{0}";
            urlTemplate = string.Format(urlTemplate, modeOfSaleCategoryId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new mode of sale category.
        /// </summary>
        /// <param name="modeOfSaleCategory"></param>
        /// <returns></returns>
        public Request Create(ModeOfSaleCategory modeOfSaleCategory, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ModeOfSaleCategory";
            bRequest.Content = modeOfSaleCategory;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/ModeOfSaleCategories/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing mode of sale category.
        /// </summary>
        /// <param name="modeOfSaleCategoryId"></param>
        /// <param name="modeOfSaleCategory"></param>
        /// <returns></returns>
        public Request Update(string modeOfSaleCategoryId, ModeOfSaleCategory modeOfSaleCategory, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ModeOfSaleCategory";
            bRequest.Content = modeOfSaleCategory;

            var urlTemplate = "TXN/ModeOfSaleCategories/{0}";
            urlTemplate = string.Format(urlTemplate, modeOfSaleCategoryId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing mode of sale category.
        /// </summary>
        /// <param name="modeOfSaleCategoryId"></param>
        public Request Delete(string modeOfSaleCategoryId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/ModeOfSaleCategories/{0}";
            urlTemplate = string.Format(urlTemplate, modeOfSaleCategoryId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ModeOfSaleOffersFacade
    {
        private IRestClient restClient;

        public ModeOfSaleOffersFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<ModeOfSaleOffers>> GetAll()
        {
            return await restClient.AtUrl("TXN/ModeOfSaleOffers/").Get<ModeOfSaleOffers>();
        }

        /// <summary>
        /// Get details of a mode of sale price type.
        /// </summary>
        /// <param name="modeOfSaleOfferId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ModeOfSaleOffer>> Get(string modeOfSaleOfferId = "")
        {
             var urlTemplate = "TXN/ModeOfSaleOffers/{0}";
             urlTemplate = string.Format(urlTemplate, modeOfSaleOfferId);
            return await restClient.AtUrl(urlTemplate).Get<ModeOfSaleOffer>();
        }

        /// <summary>
        /// Create a new mode of sale price type.
        /// </summary>
        /// <param name="modeOfSaleOffer"></param>
        /// <returns></returns>
        public async Task<RestResponse<ModeOfSaleOffer>> Create(ModeOfSaleOffer modeOfSaleOffer)
        {
            return await restClient.AtUrl("TXN/ModeOfSaleOffers/").Post<ModeOfSaleOffer, ModeOfSaleOffer>(modeOfSaleOffer);
        }

        /// <summary>
        /// Update an existing mode of sale price type.
        /// </summary>
        /// <param name="modeOfSaleOfferId"></param>
        /// <param name="modeOfSaleOffer"></param>
        /// <returns></returns>
        public async Task<RestResponse<ModeOfSaleOffer>> Update(string modeOfSaleOfferId, ModeOfSaleOffer modeOfSaleOffer)
        {
             var urlTemplate = "TXN/ModeOfSaleOffers/{0}";
             urlTemplate = string.Format(urlTemplate, modeOfSaleOfferId);
            return await restClient.AtUrl(urlTemplate).Put<ModeOfSaleOffer, ModeOfSaleOffer>(modeOfSaleOffer);
        }

        /// <summary>
        /// Delete an existing mode of sale price type.
        /// </summary>
        /// <param name="modeOfSaleOfferId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string modeOfSaleOfferId)
        {
             var urlTemplate = "TXN/ModeOfSaleOffers/{0}";
             urlTemplate = string.Format(urlTemplate, modeOfSaleOfferId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ModeOfSaleOffersFacadeBatch
    {
        private IRestClient restClient;

        public ModeOfSaleOffersFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ModeOfSaleOffers";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/ModeOfSaleOffers/";

            return bRequest;
        }

        /// <summary>
        /// Get details of a mode of sale price type.
        /// </summary>
        /// <param name="modeOfSaleOfferId"></param>
        /// <returns></returns>
        public Request Get(string modeOfSaleOfferId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ModeOfSaleOffer";
            bRequest.Content = null;

            var urlTemplate = "TXN/ModeOfSaleOffers/{0}";
            urlTemplate = string.Format(urlTemplate, modeOfSaleOfferId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new mode of sale price type.
        /// </summary>
        /// <param name="modeOfSaleOffer"></param>
        /// <returns></returns>
        public Request Create(ModeOfSaleOffer modeOfSaleOffer, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ModeOfSaleOffer";
            bRequest.Content = modeOfSaleOffer;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/ModeOfSaleOffers/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing mode of sale price type.
        /// </summary>
        /// <param name="modeOfSaleOfferId"></param>
        /// <param name="modeOfSaleOffer"></param>
        /// <returns></returns>
        public Request Update(string modeOfSaleOfferId, ModeOfSaleOffer modeOfSaleOffer, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ModeOfSaleOffer";
            bRequest.Content = modeOfSaleOffer;

            var urlTemplate = "TXN/ModeOfSaleOffers/{0}";
            urlTemplate = string.Format(urlTemplate, modeOfSaleOfferId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing mode of sale price type.
        /// </summary>
        /// <param name="modeOfSaleOfferId"></param>
        public Request Delete(string modeOfSaleOfferId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/ModeOfSaleOffers/{0}";
            urlTemplate = string.Format(urlTemplate, modeOfSaleOfferId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ModeOfSalePriceTypesFacade
    {
        private IRestClient restClient;

        public ModeOfSalePriceTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all mode of sale price types.
        /// </summary>
        /// <param name="modeOfSaleId"></param>
        /// <param name="priceTypeId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ModeOfSalePriceTypes>> GetAll(string modeOfSaleId = "", string priceTypeId = "")
        {
            var urlTemplate = "TXN/ModeOfSalePriceTypes/?modeOfSaleId={0}&priceTypeId={1}";
            urlTemplate = string.Format(urlTemplate, modeOfSaleId,priceTypeId);
            return await restClient.AtUrl(urlTemplate).Get<ModeOfSalePriceTypes>();
        }

        /// <summary>
        /// Get details of a mode of sale price type.
        /// </summary>
        /// <param name="modeOfSalePriceTypeId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ModeOfSalePriceType>> Get(string modeOfSalePriceTypeId = "")
        {
             var urlTemplate = "TXN/ModeOfSalePriceTypes/{0}";
             urlTemplate = string.Format(urlTemplate, modeOfSalePriceTypeId);
            return await restClient.AtUrl(urlTemplate).Get<ModeOfSalePriceType>();
        }

        /// <summary>
        /// Create a new mode of sale price type.
        /// </summary>
        /// <param name="modeOfSalePriceType"></param>
        /// <returns></returns>
        public async Task<RestResponse<ModeOfSalePriceType>> Create(ModeOfSalePriceType modeOfSalePriceType)
        {
            return await restClient.AtUrl("TXN/ModeOfSalePriceTypes/").Post<ModeOfSalePriceType, ModeOfSalePriceType>(modeOfSalePriceType);
        }

        /// <summary>
        /// Update an existing mode of sale price type.
        /// </summary>
        /// <param name="modeOfSalePriceTypeId"></param>
        /// <param name="modeOfSalePriceType"></param>
        /// <returns></returns>
        public async Task<RestResponse<ModeOfSalePriceType>> Update(string modeOfSalePriceTypeId, ModeOfSalePriceType modeOfSalePriceType)
        {
             var urlTemplate = "TXN/ModeOfSalePriceTypes/{0}";
             urlTemplate = string.Format(urlTemplate, modeOfSalePriceTypeId);
            return await restClient.AtUrl(urlTemplate).Put<ModeOfSalePriceType, ModeOfSalePriceType>(modeOfSalePriceType);
        }

        /// <summary>
        /// Delete an existing mode of sale price type.
        /// </summary>
        /// <param name="modeOfSalePriceTypeId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string modeOfSalePriceTypeId)
        {
             var urlTemplate = "TXN/ModeOfSalePriceTypes/{0}";
             urlTemplate = string.Format(urlTemplate, modeOfSalePriceTypeId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ModeOfSalePriceTypesFacadeBatch
    {
        private IRestClient restClient;

        public ModeOfSalePriceTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all mode of sale price types.
        /// </summary>
        /// <param name="modeOfSaleId"></param>
        /// <param name="priceTypeId"></param>
        /// <returns></returns>
        public Request GetAll(string modeOfSaleId = "", string priceTypeId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ModeOfSalePriceTypes";
            bRequest.Content = null;

            var urlTemplate = "TXN/ModeOfSalePriceTypes/?modeOfSaleId={0}&priceTypeId={1}";
            urlTemplate = string.Format(urlTemplate, modeOfSaleId,priceTypeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a mode of sale price type.
        /// </summary>
        /// <param name="modeOfSalePriceTypeId"></param>
        /// <returns></returns>
        public Request Get(string modeOfSalePriceTypeId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ModeOfSalePriceType";
            bRequest.Content = null;

            var urlTemplate = "TXN/ModeOfSalePriceTypes/{0}";
            urlTemplate = string.Format(urlTemplate, modeOfSalePriceTypeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new mode of sale price type.
        /// </summary>
        /// <param name="modeOfSalePriceType"></param>
        /// <returns></returns>
        public Request Create(ModeOfSalePriceType modeOfSalePriceType, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ModeOfSalePriceType";
            bRequest.Content = modeOfSalePriceType;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/ModeOfSalePriceTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing mode of sale price type.
        /// </summary>
        /// <param name="modeOfSalePriceTypeId"></param>
        /// <param name="modeOfSalePriceType"></param>
        /// <returns></returns>
        public Request Update(string modeOfSalePriceTypeId, ModeOfSalePriceType modeOfSalePriceType, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ModeOfSalePriceType";
            bRequest.Content = modeOfSalePriceType;

            var urlTemplate = "TXN/ModeOfSalePriceTypes/{0}";
            urlTemplate = string.Format(urlTemplate, modeOfSalePriceTypeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing mode of sale price type.
        /// </summary>
        /// <param name="modeOfSalePriceTypeId"></param>
        public Request Delete(string modeOfSalePriceTypeId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/ModeOfSalePriceTypes/{0}";
            urlTemplate = string.Format(urlTemplate, modeOfSalePriceTypeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ModeOfSaleSurveyQuestionsFacade
    {
        private IRestClient restClient;

        public ModeOfSaleSurveyQuestionsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all mode of sale survey questions.
        /// </summary>
        /// <param name="modeOfSaleId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ModeOfSaleSurveyQuestions>> GetAll(string modeOfSaleId = "")
        {
            var urlTemplate = "TXN/ModeOfSaleSurveyQuestions/?modeOfSaleId={0}";
            urlTemplate = string.Format(urlTemplate, modeOfSaleId);
            return await restClient.AtUrl(urlTemplate).Get<ModeOfSaleSurveyQuestions>();
        }

        /// <summary>
        /// Get details of a mode of sale survey question.
        /// </summary>
        /// <param name="modeOfSaleSurveyQuestionId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ModeOfSaleSurveyQuestion>> Get(string modeOfSaleSurveyQuestionId = "")
        {
             var urlTemplate = "TXN/ModeOfSaleSurveyQuestions/{0}";
             urlTemplate = string.Format(urlTemplate, modeOfSaleSurveyQuestionId);
            return await restClient.AtUrl(urlTemplate).Get<ModeOfSaleSurveyQuestion>();
        }

        /// <summary>
        /// Create a new mode of sale survey question.
        /// </summary>
        /// <param name="modeOfSaleSurveyQuestion"></param>
        /// <returns></returns>
        public async Task<RestResponse<ModeOfSaleSurveyQuestion>> Create(ModeOfSaleSurveyQuestion modeOfSaleSurveyQuestion)
        {
            return await restClient.AtUrl("TXN/ModeOfSaleSurveyQuestions/").Post<ModeOfSaleSurveyQuestion, ModeOfSaleSurveyQuestion>(modeOfSaleSurveyQuestion);
        }

        /// <summary>
        /// Update an existing mode of sale survey question.
        /// </summary>
        /// <param name="modeOfSaleSurveyQuestionId"></param>
        /// <param name="modeOfSaleSurveyQuestion"></param>
        /// <returns></returns>
        public async Task<RestResponse<ModeOfSaleSurveyQuestion>> Update(string modeOfSaleSurveyQuestionId, ModeOfSaleSurveyQuestion modeOfSaleSurveyQuestion)
        {
             var urlTemplate = "TXN/ModeOfSaleSurveyQuestions/{0}";
             urlTemplate = string.Format(urlTemplate, modeOfSaleSurveyQuestionId);
            return await restClient.AtUrl(urlTemplate).Put<ModeOfSaleSurveyQuestion, ModeOfSaleSurveyQuestion>(modeOfSaleSurveyQuestion);
        }

        /// <summary>
        /// Delete an existing mode of sale survey question.
        /// </summary>
        /// <param name="modeOfSaleSurveyQuestionId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string modeOfSaleSurveyQuestionId)
        {
             var urlTemplate = "TXN/ModeOfSaleSurveyQuestions/{0}";
             urlTemplate = string.Format(urlTemplate, modeOfSaleSurveyQuestionId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ModeOfSaleSurveyQuestionsFacadeBatch
    {
        private IRestClient restClient;

        public ModeOfSaleSurveyQuestionsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all mode of sale survey questions.
        /// </summary>
        /// <param name="modeOfSaleId"></param>
        /// <returns></returns>
        public Request GetAll(string modeOfSaleId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ModeOfSaleSurveyQuestions";
            bRequest.Content = null;

            var urlTemplate = "TXN/ModeOfSaleSurveyQuestions/?modeOfSaleId={0}";
            urlTemplate = string.Format(urlTemplate, modeOfSaleId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a mode of sale survey question.
        /// </summary>
        /// <param name="modeOfSaleSurveyQuestionId"></param>
        /// <returns></returns>
        public Request Get(string modeOfSaleSurveyQuestionId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ModeOfSaleSurveyQuestion";
            bRequest.Content = null;

            var urlTemplate = "TXN/ModeOfSaleSurveyQuestions/{0}";
            urlTemplate = string.Format(urlTemplate, modeOfSaleSurveyQuestionId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new mode of sale survey question.
        /// </summary>
        /// <param name="modeOfSaleSurveyQuestion"></param>
        /// <returns></returns>
        public Request Create(ModeOfSaleSurveyQuestion modeOfSaleSurveyQuestion, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ModeOfSaleSurveyQuestion";
            bRequest.Content = modeOfSaleSurveyQuestion;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/ModeOfSaleSurveyQuestions/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing mode of sale survey question.
        /// </summary>
        /// <param name="modeOfSaleSurveyQuestionId"></param>
        /// <param name="modeOfSaleSurveyQuestion"></param>
        /// <returns></returns>
        public Request Update(string modeOfSaleSurveyQuestionId, ModeOfSaleSurveyQuestion modeOfSaleSurveyQuestion, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ModeOfSaleSurveyQuestion";
            bRequest.Content = modeOfSaleSurveyQuestion;

            var urlTemplate = "TXN/ModeOfSaleSurveyQuestions/{0}";
            urlTemplate = string.Format(urlTemplate, modeOfSaleSurveyQuestionId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing mode of sale survey question.
        /// </summary>
        /// <param name="modeOfSaleSurveyQuestionId"></param>
        public Request Delete(string modeOfSaleSurveyQuestionId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/ModeOfSaleSurveyQuestions/{0}";
            urlTemplate = string.Format(urlTemplate, modeOfSaleSurveyQuestionId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ModesOfSaleFacade
    {
        private IRestClient restClient;

        public ModesOfSaleFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<ModesOfSale>> GetAll()
        {
            return await restClient.AtUrl("TXN/ModesOfSale/").Get<ModesOfSale>();
        }

        /// 
        public async Task<RestResponse<ModeOfSaleSummaries>> GetAllSummaries()
        {
            return await restClient.AtUrl("TXN/ModesOfSale/Summary").Get<ModeOfSaleSummaries>();
        }

        /// <summary>
        /// Get details of an existing mode of sale.
        /// </summary>
        /// <param name="modeOfSaleId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ModeOfSale>> Get(string modeOfSaleId = "")
        {
             var urlTemplate = "TXN/ModesOfSale/{0}";
             urlTemplate = string.Format(urlTemplate, modeOfSaleId);
            return await restClient.AtUrl(urlTemplate).Get<ModeOfSale>();
        }

        /// <summary>
        /// Create a new mode of sale.
        /// </summary>
        /// <param name="modeOfSale"></param>
        /// <returns></returns>
        public async Task<RestResponse<ModeOfSale>> Create(ModeOfSale modeOfSale)
        {
            return await restClient.AtUrl("TXN/ModesOfSale/").Post<ModeOfSale, ModeOfSale>(modeOfSale);
        }

        /// <summary>
        /// Update an existing mode of sale.
        /// </summary>
        /// <param name="modeOfSaleId"></param>
        /// <param name="modeOfSale"></param>
        /// <returns></returns>
        public async Task<RestResponse<ModeOfSale>> Update(string modeOfSaleId, ModeOfSale modeOfSale)
        {
             var urlTemplate = "TXN/ModesOfSale/{0}";
             urlTemplate = string.Format(urlTemplate, modeOfSaleId);
            return await restClient.AtUrl(urlTemplate).Put<ModeOfSale, ModeOfSale>(modeOfSale);
        }

        /// <summary>
        /// Delete an existing mode of sale.
        /// </summary>
        /// <param name="modeOfSaleId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string modeOfSaleId)
        {
             var urlTemplate = "TXN/ModesOfSale/{0}";
             urlTemplate = string.Format(urlTemplate, modeOfSaleId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ModesOfSaleFacadeBatch
    {
        private IRestClient restClient;

        public ModesOfSaleFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ModesOfSale";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/ModesOfSale/";

            return bRequest;
        }

        /// 
        public Request GetAllSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ModeOfSaleSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/ModesOfSale/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get details of an existing mode of sale.
        /// </summary>
        /// <param name="modeOfSaleId"></param>
        /// <returns></returns>
        public Request Get(string modeOfSaleId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ModeOfSale";
            bRequest.Content = null;

            var urlTemplate = "TXN/ModesOfSale/{0}";
            urlTemplate = string.Format(urlTemplate, modeOfSaleId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new mode of sale.
        /// </summary>
        /// <param name="modeOfSale"></param>
        /// <returns></returns>
        public Request Create(ModeOfSale modeOfSale, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ModeOfSale";
            bRequest.Content = modeOfSale;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/ModesOfSale/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing mode of sale.
        /// </summary>
        /// <param name="modeOfSaleId"></param>
        /// <param name="modeOfSale"></param>
        /// <returns></returns>
        public Request Update(string modeOfSaleId, ModeOfSale modeOfSale, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ModeOfSale";
            bRequest.Content = modeOfSale;

            var urlTemplate = "TXN/ModesOfSale/{0}";
            urlTemplate = string.Format(urlTemplate, modeOfSaleId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing mode of sale.
        /// </summary>
        /// <param name="modeOfSaleId"></param>
        public Request Delete(string modeOfSaleId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/ModesOfSale/{0}";
            urlTemplate = string.Format(urlTemplate, modeOfSaleId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class OrderBillingFacade
    {
        private IRestClient restClient;

        public OrderBillingFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Order billing
        /// </summary>
        /// <param name="orderBillingRequest"></param>
        /// <returns></returns>
        public async Task<RestResponse<OrderBillingResponses>> BillOrders(OrderBillingRequest orderBillingRequest)
        {
            return await restClient.AtUrl("TXN/OrderBilling/").Post<OrderBillingRequest, OrderBillingResponses>(orderBillingRequest);
        }

        /// <summary>
        /// Reprint Order billing
        /// </summary>
        /// <param name="orderBillingId"></param>
        /// <returns></returns>
        public async Task<RestResponse<OrderBillingResponses>> Reprint(string orderBillingId)
        {
             var urlTemplate = "TXN/OrderBilling/Reprint/{0}";
             urlTemplate = string.Format(urlTemplate, orderBillingId);
            return await restClient.AtUrl(urlTemplate).Get<OrderBillingResponses>();
        }

    }
 

 
    /// 
    public class OrderBillingFacadeBatch
    {
        private IRestClient restClient;

        public OrderBillingFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Order billing
        /// </summary>
        /// <param name="orderBillingRequest"></param>
        /// <returns></returns>
        public Request BillOrders(OrderBillingRequest orderBillingRequest, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.OrderBillingResponses";
            bRequest.Content = orderBillingRequest;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/OrderBilling/";

            return bRequest;
        }

        /// <summary>
        /// Reprint Order billing
        /// </summary>
        /// <param name="orderBillingId"></param>
        /// <returns></returns>
        public Request Reprint(string orderBillingId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.OrderBillingResponses";
            bRequest.Content = null;

            var urlTemplate = "TXN/OrderBilling/Reprint/{0}";
            urlTemplate = string.Format(urlTemplate, orderBillingId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class OrdersFacade
    {
        private IRestClient restClient;

        public OrdersFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Create a new Order. Request data is not used at the moment. This resource is strictly for interceptor plugin use.
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        public async Task<RestResponse<Order>> Create(Order order)
        {
            return await restClient.AtUrl("TXN/Orders/").Post<Order, Order>(order);
        }

        /// <summary>
        /// Prices an order(including pricing rules). Should have atleast one line item, with each line item having atleast one sub line item.
        /// Individual sub line items can be ignored for pricing by passing ApplyPricing = false, on those sub line items.
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        public async Task<RestResponse<Order>> Price(Order order)
        {
            return await restClient.AtUrl("TXN/Orders/Price/").Post<Order, Order>(order);
        }

        /// <summary>
        /// Get the details of an existing Order in a Product view similar to Web/Cart
        /// </summary>
        /// <param name="orderId"></param>
        /// <returns></returns>
        public async Task<RestResponse<OrderProductView>> GetProductsView(string orderId)
        {
             var urlTemplate = "TXN/Orders/{0}/ProductsView";
             urlTemplate = string.Format(urlTemplate, orderId);
            return await restClient.AtUrl(urlTemplate).Get<OrderProductView>();
        }

        /// <summary>
        /// Update an existing Order. Request data is not used at the moment. This resource is strictly for interceptor plugin use.
        /// </summary>
        /// <param name="orderId"></param>
        /// <param name="order"></param>
        /// <returns></returns>
        public async Task<RestResponse<Order>> Update(string orderId, Order order)
        {
             var urlTemplate = "TXN/Orders/{0}";
             urlTemplate = string.Format(urlTemplate, orderId);
            return await restClient.AtUrl(urlTemplate).Put<Order, Order>(order);
        }

    }
 

 
    /// 
    public class OrdersFacadeBatch
    {
        private IRestClient restClient;

        public OrdersFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Create a new Order. Request data is not used at the moment. This resource is strictly for interceptor plugin use.
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        public Request Create(Order order, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Order";
            bRequest.Content = order;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/Orders/";

            return bRequest;
        }

        /// <summary>
        /// Prices an order(including pricing rules). Should have atleast one line item, with each line item having atleast one sub line item.
        /// Individual sub line items can be ignored for pricing by passing ApplyPricing = false, on those sub line items.
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        public Request Price(Order order, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Order";
            bRequest.Content = order;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/Orders/Price/";

            return bRequest;
        }

        /// <summary>
        /// Get the details of an existing Order in a Product view similar to Web/Cart
        /// </summary>
        /// <param name="orderId"></param>
        /// <returns></returns>
        public Request GetProductsView(string orderId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.OrderProductView";
            bRequest.Content = null;

            var urlTemplate = "TXN/Orders/{0}/ProductsView";
            urlTemplate = string.Format(urlTemplate, orderId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Update an existing Order. Request data is not used at the moment. This resource is strictly for interceptor plugin use.
        /// </summary>
        /// <param name="orderId"></param>
        /// <param name="order"></param>
        /// <returns></returns>
        public Request Update(string orderId, Order order, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Order";
            bRequest.Content = order;

            var urlTemplate = "TXN/Orders/{0}";
            urlTemplate = string.Format(urlTemplate, orderId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PackagePriceTypesFacade
    {
        private IRestClient restClient;

        public PackagePriceTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<PackagePriceTypes>> GetAll()
        {
            return await restClient.AtUrl("TXN/PackagePriceTypes/").Get<PackagePriceTypes>();
        }

        /// <summary>
        /// Get details of a specific package price type.
        /// </summary>
        /// <param name="packagePriceTypeId"></param>
        /// <returns></returns>
        public async Task<RestResponse<PackagePriceType>> Get(string packagePriceTypeId = "")
        {
             var urlTemplate = "TXN/PackagePriceTypes/{0}";
             urlTemplate = string.Format(urlTemplate, packagePriceTypeId);
            return await restClient.AtUrl(urlTemplate).Get<PackagePriceType>();
        }

        /// <summary>
        /// Create a new package price type.
        /// </summary>
        /// <param name="packagePriceType"></param>
        /// <returns></returns>
        public async Task<RestResponse<PackagePriceType>> Create(PackagePriceType packagePriceType)
        {
            return await restClient.AtUrl("TXN/PackagePriceTypes/").Post<PackagePriceType, PackagePriceType>(packagePriceType);
        }

        /// <summary>
        /// Update an existing package price type.
        /// </summary>
        /// <param name="packagePriceTypeId"></param>
        /// <param name="packagePriceType"></param>
        /// <returns></returns>
        public async Task<RestResponse<PackagePriceType>> Update(string packagePriceTypeId, PackagePriceType packagePriceType)
        {
             var urlTemplate = "TXN/PackagePriceTypes/{0}";
             urlTemplate = string.Format(urlTemplate, packagePriceTypeId);
            return await restClient.AtUrl(urlTemplate).Put<PackagePriceType, PackagePriceType>(packagePriceType);
        }

        /// <summary>
        /// Delete an existing package price type.
        /// </summary>
        /// <param name="packagePriceTypeId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string packagePriceTypeId)
        {
             var urlTemplate = "TXN/PackagePriceTypes/{0}";
             urlTemplate = string.Format(urlTemplate, packagePriceTypeId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PackagePriceTypesFacadeBatch
    {
        private IRestClient restClient;

        public PackagePriceTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PackagePriceTypes";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PackagePriceTypes/";

            return bRequest;
        }

        /// <summary>
        /// Get details of a specific package price type.
        /// </summary>
        /// <param name="packagePriceTypeId"></param>
        /// <returns></returns>
        public Request Get(string packagePriceTypeId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PackagePriceType";
            bRequest.Content = null;

            var urlTemplate = "TXN/PackagePriceTypes/{0}";
            urlTemplate = string.Format(urlTemplate, packagePriceTypeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new package price type.
        /// </summary>
        /// <param name="packagePriceType"></param>
        /// <returns></returns>
        public Request Create(PackagePriceType packagePriceType, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PackagePriceType";
            bRequest.Content = packagePriceType;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PackagePriceTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing package price type.
        /// </summary>
        /// <param name="packagePriceTypeId"></param>
        /// <param name="packagePriceType"></param>
        /// <returns></returns>
        public Request Update(string packagePriceTypeId, PackagePriceType packagePriceType, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PackagePriceType";
            bRequest.Content = packagePriceType;

            var urlTemplate = "TXN/PackagePriceTypes/{0}";
            urlTemplate = string.Format(urlTemplate, packagePriceTypeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing package price type.
        /// </summary>
        /// <param name="packagePriceTypeId"></param>
        public Request Delete(string packagePriceTypeId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/PackagePriceTypes/{0}";
            urlTemplate = string.Format(urlTemplate, packagePriceTypeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PackagesFacade
    {
        private IRestClient restClient;

        public PackagesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all packages. Optionally filtered by a season.
        /// </summary>
        /// <param name="seasonId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Packages>> GetAll(string seasonId = "")
        {
            var urlTemplate = "TXN/Packages/?seasonId={0}";
            urlTemplate = string.Format(urlTemplate, seasonId);
            return await restClient.AtUrl(urlTemplate).Get<Packages>();
        }

        /// <summary>
        /// Get summary of all packages. Optionally filtered by a season.
        /// </summary>
        /// <param name="seasonId"></param>
        /// <returns></returns>
        public async Task<RestResponse<PackageSummaries>> GetSummaries(string seasonId = "")
        {
            var urlTemplate = "TXN/Packages/Summary/?seasonId={0}";
            urlTemplate = string.Format(urlTemplate, seasonId);
            return await restClient.AtUrl(urlTemplate).Get<PackageSummaries>();
        }

        /// <summary>
        /// Get details of a package.
        /// </summary>
        /// <param name="packageId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Package>> Get(string packageId = "")
        {
             var urlTemplate = "TXN/Packages/{0}";
             urlTemplate = string.Format(urlTemplate, packageId);
            return await restClient.AtUrl(urlTemplate).Get<Package>();
        }

        /// <summary>
        /// Get the package and its pricing details. Pass asOfDateTime to get prices effective on that date time.
        /// </summary>
        /// <param name="packageId"></param>
        /// <param name="asOfDateTime"></param>
        /// <param name="modeOfSaleId"></param>
        /// <param name="priceTypeId"></param>
        /// <param name="expandPerformancePriceType"></param>
        /// <param name="includeOnlyBasePrice"></param>
        /// <param name="performanceIds"></param>
        /// <param name="sourceId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Prices>> GetPrices(string packageId = "", string asOfDateTime = "", string modeOfSaleId = "", string priceTypeId = "", string expandPerformancePriceType = "", string includeOnlyBasePrice = "", string performanceIds = "", string sourceId = "")
        {
             var urlTemplate = "TXN/Packages/{0}/Prices?asOfDateTime={1}&modeOfSaleId={2}&priceTypeId={3}&expandPerformancePriceType={4}&includeOnlyBasePrice={5}&performanceIds={6}&sourceId={7}";
             urlTemplate = string.Format(urlTemplate, packageId, asOfDateTime, modeOfSaleId, priceTypeId, expandPerformancePriceType, includeOnlyBasePrice, performanceIds, sourceId);
            return await restClient.AtUrl(urlTemplate).Get<Prices>();
        }

        /// <summary>
        /// Gets detailed information about the package including sub packages and performance groups.
        /// </summary>
        /// <param name="packageId"></param>
        /// <param name="asOfDateTime"></param>
        /// <param name="modeOfSaleId"></param>
        /// <param name="priceTypeId"></param>
        /// <param name="sourceId"></param>
        /// <returns></returns>
        public async Task<RestResponse<PackageDetail>> GetPackageDetail(string packageId, string asOfDateTime = "", string modeOfSaleId = "", string priceTypeId = "", string sourceId = "")
        {
             var urlTemplate = "TXN/Packages/{0}/Details?asOfDateTime={1}&modeOfSaleId={2}&priceTypeId={3}&sourceId={4}";
             urlTemplate = string.Format(urlTemplate, packageId, asOfDateTime, modeOfSaleId, priceTypeId, sourceId);
            return await restClient.AtUrl(urlTemplate).Get<PackageDetail>();
        }

        /// <summary>
        /// Get details of Performance Groups and their Performances for flex package selection.
        /// </summary>
        /// <param name="packageId"></param>
        /// <param name="asOfDateTime"></param>
        /// <param name="modeOfSaleId"></param>
        /// <param name="priceTypeId"></param>
        /// <param name="sourceId"></param>
        /// <returns></returns>
        public async Task<RestResponse<PackagePerformanceGroupDetails>> GetPerformanceGroupDetails(string packageId = "", string asOfDateTime = "", string modeOfSaleId = "", string priceTypeId = "", string sourceId = "")
        {
             var urlTemplate = "TXN/Packages/{0}/PerformanceGroups?asOfDateTime={1}&modeOfSaleId={2}&priceTypeId={3}&sourceId={4}";
             urlTemplate = string.Format(urlTemplate, packageId, asOfDateTime, modeOfSaleId, priceTypeId, sourceId);
            return await restClient.AtUrl(urlTemplate).Get<PackagePerformanceGroupDetails>();
        }

        /// <summary>
        /// Returns details for seats in a fixed-seat package
        /// The seats returned can be filtered by screen, section, or price zone. Allocation is returned based on MOS and constituent.
        /// Available seats can be filtered by price type availability, causing any seats that are not available for the specified price types to be listed with a status of 5, Not In Allocation.
        /// </summary>
        /// <param name="packageId">ID of the fixed seat package</param>
        /// <param name="modeOfSaleId">Required parameter. Must be a valid MOS id</param>
        /// <param name="constituentId">Required parameter. Must be a valid constituent ID</param>
        /// <param name="zoneIds">zoneIds must be a comma seperated list of valid zone ids</param>
        /// <param name="sectionIds">sectionIds must be a comma seperated list of valid section ids</param>
        /// <param name="screenIds">screenIds must be a comma seperated list of valid screen ids for the specified performance</param>
        /// <param name="checkPriceTypeIds">checkPriceTypeIds must be either a list of valid price types or the token “All” </param>
        /// <param name="returnNonSeats">returnNonSeats indicates if locations on the seat map that are not seats should be included</param>
        /// <returns></returns>
        public async Task<RestResponse<Seats>> GetSeats(string packageId, string modeOfSaleId = "null", string constituentId = "null", string zoneIds = "null", string sectionIds = "null", string screenIds = "null", string checkPriceTypeIds = "null", string returnNonSeats = "null")
        {
             var urlTemplate = "TXN/Packages/{0}/Seats?modeOfSaleId={1}&constituentId={2}&zoneIds={3}&sectionIds={4}&screenIds={5}&checkPriceTypeIds={6}&returnNonSeats={7}";
             urlTemplate = string.Format(urlTemplate, packageId, modeOfSaleId, constituentId, zoneIds, sectionIds, screenIds, checkPriceTypeIds, returnNonSeats);
            return await restClient.AtUrl(urlTemplate).Get<Seats>();
        }

        /// <summary>
        /// Returns summary for seats in a package
        /// Seat availability is summaried by screen, section and zone.
        /// The seats returned can be filtered by screen, section, or price zone. Allocation is returned based on MOS and constituent.
        /// Available seats can be filtered by price type availability, causing any seats that are not available for the specified price types to be listed with a status of 5, Not In Allocation.
        /// </summary>
        /// <param name="packageId">ID of the fixed seat package</param>
        /// <param name="modeOfSaleId">Required parameter. Must be a valid MOS id</param>
        /// <param name="constituentId">Required parameter. Must be a valid constituent ID</param>
        /// <param name="zoneIds">zoneIds must be a comma seperated list of valid zone ids</param>
        /// <param name="sectionIds">sectionIds must be a comma seperated list of valid section ids</param>
        /// <param name="screenIds">screenIds must be a comma seperated list of valid screen ids for the specified performance</param>
        /// <param name="checkPriceTypeIds">checkPriceTypeIds must be either a list of valid price types or the token “All” </param>
        /// <param name="returnNonSeats">returnNonSeats indicates if locations on the seat map that are not seats should be included</param>
        /// <returns></returns>
        public async Task<RestResponse<SeatSummaries>> GetSeatSummaries(string packageId, string modeOfSaleId = "null", string constituentId = "null", string zoneIds = "null", string sectionIds = "null", string screenIds = "null", string checkPriceTypeIds = "null", string returnNonSeats = "null")
        {
             var urlTemplate = "TXN/Packages/{0}/Seats/Summary?modeOfSaleId={1}&constituentId={2}&zoneIds={3}&sectionIds={4}&screenIds={5}&checkPriceTypeIds={6}&returnNonSeats={7}";
             urlTemplate = string.Format(urlTemplate, packageId, modeOfSaleId, constituentId, zoneIds, sectionIds, screenIds, checkPriceTypeIds, returnNonSeats);
            return await restClient.AtUrl(urlTemplate).Get<SeatSummaries>();
        }

        /// <summary>
        /// Returns price, per seat fees, for each zone and price type for the specified package
        /// </summary>
        /// <param name="packageId"></param>
        /// <param name="modeOfSaleId">Required, Must be a valid id from TR_MOS</param>
        /// <param name="priceTypeIds">A list of valid ids from TR_PRICE_TYPE. Filters the results</param>
        /// <param name="asOfDateTime">Date for pricing. Defaults to today</param>
        /// <returns></returns>
        public async Task<RestResponse<ProductSeatFees>> GetSeatFees(string packageId, string modeOfSaleId, string priceTypeIds = "null", string asOfDateTime = "null")
        {
             var urlTemplate = "TXN/Packages/{0}/SeatFees?modeOfSaleId={1}&priceTypeIds={2}&asOfDateTime={3}";
             urlTemplate = string.Format(urlTemplate, packageId, modeOfSaleId, priceTypeIds, asOfDateTime);
            return await restClient.AtUrl(urlTemplate).Get<ProductSeatFees>();
        }

        /// <summary>
        /// Search for packages
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<PackageSearchResponses>> Search(PackageSearchRequest request)
        {
            return await restClient.AtUrl("TXN/Packages/Search").Post<PackageSearchRequest, PackageSearchResponses>(request);
        }

    }
 

 
    /// 
    public class PackagesFacadeBatch
    {
        private IRestClient restClient;

        public PackagesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all packages. Optionally filtered by a season.
        /// </summary>
        /// <param name="seasonId"></param>
        /// <returns></returns>
        public Request GetAll(string seasonId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Packages";
            bRequest.Content = null;

            var urlTemplate = "TXN/Packages/?seasonId={0}";
            urlTemplate = string.Format(urlTemplate, seasonId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get summary of all packages. Optionally filtered by a season.
        /// </summary>
        /// <param name="seasonId"></param>
        /// <returns></returns>
        public Request GetSummaries(string seasonId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PackageSummaries";
            bRequest.Content = null;

            var urlTemplate = "TXN/Packages/Summary/?seasonId={0}";
            urlTemplate = string.Format(urlTemplate, seasonId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a package.
        /// </summary>
        /// <param name="packageId"></param>
        /// <returns></returns>
        public Request Get(string packageId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Package";
            bRequest.Content = null;

            var urlTemplate = "TXN/Packages/{0}";
            urlTemplate = string.Format(urlTemplate, packageId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get the package and its pricing details. Pass asOfDateTime to get prices effective on that date time.
        /// </summary>
        /// <param name="packageId"></param>
        /// <param name="asOfDateTime"></param>
        /// <param name="modeOfSaleId"></param>
        /// <param name="priceTypeId"></param>
        /// <param name="expandPerformancePriceType"></param>
        /// <param name="includeOnlyBasePrice"></param>
        /// <param name="performanceIds"></param>
        /// <param name="sourceId"></param>
        /// <returns></returns>
        public Request GetPrices(string packageId = "", string asOfDateTime = "", string modeOfSaleId = "", string priceTypeId = "", string expandPerformancePriceType = "", string includeOnlyBasePrice = "", string performanceIds = "", string sourceId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Prices";
            bRequest.Content = null;

            var urlTemplate = "TXN/Packages/{0}/Prices?asOfDateTime={1}&modeOfSaleId={2}&priceTypeId={3}&expandPerformancePriceType={4}&includeOnlyBasePrice={5}&performanceIds={6}&sourceId={7}";
            urlTemplate = string.Format(urlTemplate, packageId, asOfDateTime, modeOfSaleId, priceTypeId, expandPerformancePriceType, includeOnlyBasePrice, performanceIds, sourceId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Gets detailed information about the package including sub packages and performance groups.
        /// </summary>
        /// <param name="packageId"></param>
        /// <param name="asOfDateTime"></param>
        /// <param name="modeOfSaleId"></param>
        /// <param name="priceTypeId"></param>
        /// <param name="sourceId"></param>
        /// <returns></returns>
        public Request GetPackageDetail(string packageId, string asOfDateTime = "", string modeOfSaleId = "", string priceTypeId = "", string sourceId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PackageDetail";
            bRequest.Content = null;

            var urlTemplate = "TXN/Packages/{0}/Details?asOfDateTime={1}&modeOfSaleId={2}&priceTypeId={3}&sourceId={4}";
            urlTemplate = string.Format(urlTemplate, packageId, asOfDateTime, modeOfSaleId, priceTypeId, sourceId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of Performance Groups and their Performances for flex package selection.
        /// </summary>
        /// <param name="packageId"></param>
        /// <param name="asOfDateTime"></param>
        /// <param name="modeOfSaleId"></param>
        /// <param name="priceTypeId"></param>
        /// <param name="sourceId"></param>
        /// <returns></returns>
        public Request GetPerformanceGroupDetails(string packageId = "", string asOfDateTime = "", string modeOfSaleId = "", string priceTypeId = "", string sourceId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PackagePerformanceGroupDetails";
            bRequest.Content = null;

            var urlTemplate = "TXN/Packages/{0}/PerformanceGroups?asOfDateTime={1}&modeOfSaleId={2}&priceTypeId={3}&sourceId={4}";
            urlTemplate = string.Format(urlTemplate, packageId, asOfDateTime, modeOfSaleId, priceTypeId, sourceId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Returns details for seats in a fixed-seat package
        /// The seats returned can be filtered by screen, section, or price zone. Allocation is returned based on MOS and constituent.
        /// Available seats can be filtered by price type availability, causing any seats that are not available for the specified price types to be listed with a status of 5, Not In Allocation.
        /// </summary>
        /// <param name="packageId">ID of the fixed seat package</param>
        /// <param name="modeOfSaleId">Required parameter. Must be a valid MOS id</param>
        /// <param name="constituentId">Required parameter. Must be a valid constituent ID</param>
        /// <param name="zoneIds">zoneIds must be a comma seperated list of valid zone ids</param>
        /// <param name="sectionIds">sectionIds must be a comma seperated list of valid section ids</param>
        /// <param name="screenIds">screenIds must be a comma seperated list of valid screen ids for the specified performance</param>
        /// <param name="checkPriceTypeIds">checkPriceTypeIds must be either a list of valid price types or the token “All” </param>
        /// <param name="returnNonSeats">returnNonSeats indicates if locations on the seat map that are not seats should be included</param>
        /// <returns></returns>
        public Request GetSeats(string packageId, string modeOfSaleId = "null", string constituentId = "null", string zoneIds = "null", string sectionIds = "null", string screenIds = "null", string checkPriceTypeIds = "null", string returnNonSeats = "null", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Seats";
            bRequest.Content = null;

            var urlTemplate = "TXN/Packages/{0}/Seats?modeOfSaleId={1}&constituentId={2}&zoneIds={3}&sectionIds={4}&screenIds={5}&checkPriceTypeIds={6}&returnNonSeats={7}";
            urlTemplate = string.Format(urlTemplate, packageId, modeOfSaleId, constituentId, zoneIds, sectionIds, screenIds, checkPriceTypeIds, returnNonSeats);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Returns summary for seats in a package
        /// Seat availability is summaried by screen, section and zone.
        /// The seats returned can be filtered by screen, section, or price zone. Allocation is returned based on MOS and constituent.
        /// Available seats can be filtered by price type availability, causing any seats that are not available for the specified price types to be listed with a status of 5, Not In Allocation.
        /// </summary>
        /// <param name="packageId">ID of the fixed seat package</param>
        /// <param name="modeOfSaleId">Required parameter. Must be a valid MOS id</param>
        /// <param name="constituentId">Required parameter. Must be a valid constituent ID</param>
        /// <param name="zoneIds">zoneIds must be a comma seperated list of valid zone ids</param>
        /// <param name="sectionIds">sectionIds must be a comma seperated list of valid section ids</param>
        /// <param name="screenIds">screenIds must be a comma seperated list of valid screen ids for the specified performance</param>
        /// <param name="checkPriceTypeIds">checkPriceTypeIds must be either a list of valid price types or the token “All” </param>
        /// <param name="returnNonSeats">returnNonSeats indicates if locations on the seat map that are not seats should be included</param>
        /// <returns></returns>
        public Request GetSeatSummaries(string packageId, string modeOfSaleId = "null", string constituentId = "null", string zoneIds = "null", string sectionIds = "null", string screenIds = "null", string checkPriceTypeIds = "null", string returnNonSeats = "null", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SeatSummaries";
            bRequest.Content = null;

            var urlTemplate = "TXN/Packages/{0}/Seats/Summary?modeOfSaleId={1}&constituentId={2}&zoneIds={3}&sectionIds={4}&screenIds={5}&checkPriceTypeIds={6}&returnNonSeats={7}";
            urlTemplate = string.Format(urlTemplate, packageId, modeOfSaleId, constituentId, zoneIds, sectionIds, screenIds, checkPriceTypeIds, returnNonSeats);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Returns price, per seat fees, for each zone and price type for the specified package
        /// </summary>
        /// <param name="packageId"></param>
        /// <param name="modeOfSaleId">Required, Must be a valid id from TR_MOS</param>
        /// <param name="priceTypeIds">A list of valid ids from TR_PRICE_TYPE. Filters the results</param>
        /// <param name="asOfDateTime">Date for pricing. Defaults to today</param>
        /// <returns></returns>
        public Request GetSeatFees(string packageId, string modeOfSaleId, string priceTypeIds = "null", string asOfDateTime = "null", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ProductSeatFees";
            bRequest.Content = null;

            var urlTemplate = "TXN/Packages/{0}/SeatFees?modeOfSaleId={1}&priceTypeIds={2}&asOfDateTime={3}";
            urlTemplate = string.Format(urlTemplate, packageId, modeOfSaleId, priceTypeIds, asOfDateTime);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Search for packages
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request Search(PackageSearchRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PackageSearchResponses";
            bRequest.Content = request;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/Packages/Search";

            return bRequest;
        }

    }
 

 
    /// 
    public class PaymentMethodsFacade
    {
        private IRestClient restClient;

        public PaymentMethodsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all payment methods.
        /// </summary>
        /// <param name="paymentTypeIds"></param>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public async Task<RestResponse<PaymentMethods>> GetAll(string paymentTypeIds = "", string maintenanceMode = "false")
        {
            var urlTemplate = "TXN/PaymentMethods/?paymentTypeIds={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, paymentTypeIds,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PaymentMethods>();
        }

        /// <summary>
        /// Get details of a payment method.
        /// </summary>
        /// <param name="paymentMethodId"></param>
        /// <returns></returns>
        public async Task<RestResponse<PaymentMethod>> Get(string paymentMethodId = "")
        {
             var urlTemplate = "TXN/PaymentMethods/{0}";
             urlTemplate = string.Format(urlTemplate, paymentMethodId);
            return await restClient.AtUrl(urlTemplate).Get<PaymentMethod>();
        }

        /// <summary>
        /// Create a new payment method.
        /// </summary>
        /// <param name="paymentMethod"></param>
        /// <returns></returns>
        public async Task<RestResponse<PaymentMethod>> Create(PaymentMethod paymentMethod)
        {
            return await restClient.AtUrl("TXN/PaymentMethods/").Post<PaymentMethod, PaymentMethod>(paymentMethod);
        }

        /// <summary>
        /// Update an existing payment method.
        /// </summary>
        /// <param name="paymentMethodId"></param>
        /// <param name="paymentMethod"></param>
        /// <returns></returns>
        public async Task<RestResponse<PaymentMethod>> Update(string paymentMethodId, PaymentMethod paymentMethod)
        {
             var urlTemplate = "TXN/PaymentMethods/{0}";
             urlTemplate = string.Format(urlTemplate, paymentMethodId);
            return await restClient.AtUrl(urlTemplate).Put<PaymentMethod, PaymentMethod>(paymentMethod);
        }

        /// <summary>
        /// Delete an existing payment method.
        /// </summary>
        /// <param name="paymentMethodId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string paymentMethodId)
        {
             var urlTemplate = "TXN/PaymentMethods/{0}";
             urlTemplate = string.Format(urlTemplate, paymentMethodId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PaymentMethodsFacadeBatch
    {
        private IRestClient restClient;

        public PaymentMethodsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all payment methods.
        /// </summary>
        /// <param name="paymentTypeIds"></param>
        /// <param name="maintenanceMode"></param>
        /// <returns></returns>
        public Request GetAll(string paymentTypeIds = "", string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentMethods";
            bRequest.Content = null;

            var urlTemplate = "TXN/PaymentMethods/?paymentTypeIds={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, paymentTypeIds,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a payment method.
        /// </summary>
        /// <param name="paymentMethodId"></param>
        /// <returns></returns>
        public Request Get(string paymentMethodId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentMethod";
            bRequest.Content = null;

            var urlTemplate = "TXN/PaymentMethods/{0}";
            urlTemplate = string.Format(urlTemplate, paymentMethodId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new payment method.
        /// </summary>
        /// <param name="paymentMethod"></param>
        /// <returns></returns>
        public Request Create(PaymentMethod paymentMethod, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentMethod";
            bRequest.Content = paymentMethod;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PaymentMethods/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing payment method.
        /// </summary>
        /// <param name="paymentMethodId"></param>
        /// <param name="paymentMethod"></param>
        /// <returns></returns>
        public Request Update(string paymentMethodId, PaymentMethod paymentMethod, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentMethod";
            bRequest.Content = paymentMethod;

            var urlTemplate = "TXN/PaymentMethods/{0}";
            urlTemplate = string.Format(urlTemplate, paymentMethodId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing payment method.
        /// </summary>
        /// <param name="paymentMethodId"></param>
        public Request Delete(string paymentMethodId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/PaymentMethods/{0}";
            urlTemplate = string.Format(urlTemplate, paymentMethodId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PaymentMethodUserGroupsFacade
    {
        private IRestClient restClient;

        public PaymentMethodUserGroupsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<PaymentMethodUserGroups>> GetAll(Decimal? amount = null, string maintenanceMode = "false")
        {
            var urlTemplate = "Txn/PaymentMethodUserGroups/?amount={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, amount,maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PaymentMethodUserGroups>();
        }

        /// <summary>
        /// Get details of a payment method user group.
        /// </summary>
        /// <param name="paymentMethodUserGroupId"></param>
        /// <returns></returns>
        public async Task<RestResponse<PaymentMethodUserGroup>> Get(string paymentMethodUserGroupId)
        {
             var urlTemplate = "Txn/PaymentMethodUserGroups/{0}";
             urlTemplate = string.Format(urlTemplate, paymentMethodUserGroupId);
            return await restClient.AtUrl(urlTemplate).Get<PaymentMethodUserGroup>();
        }

        /// <summary>
        /// Create a new payment method user group.
        /// </summary>
        /// <param name="paymentMethodUserGroup"></param>
        /// <returns></returns>
        public async Task<RestResponse<PaymentMethodUserGroup>> Create(PaymentMethodUserGroup paymentMethodUserGroup)
        {
            return await restClient.AtUrl("Txn/PaymentMethodUserGroups/").Post<PaymentMethodUserGroup, PaymentMethodUserGroup>(paymentMethodUserGroup);
        }

        /// <summary>
        /// Update an existing payment method user group.
        /// </summary>
        /// <param name="paymentMethodUserGroupId"></param>
        /// <param name="paymentMethodUserGroup"></param>
        /// <returns></returns>
        public async Task<RestResponse<PaymentMethodUserGroup>> Update(string paymentMethodUserGroupId, PaymentMethodUserGroup paymentMethodUserGroup)
        {
             var urlTemplate = "Txn/PaymentMethodUserGroups/{0}";
             urlTemplate = string.Format(urlTemplate, paymentMethodUserGroupId);
            return await restClient.AtUrl(urlTemplate).Put<PaymentMethodUserGroup, PaymentMethodUserGroup>(paymentMethodUserGroup);
        }

        /// <summary>
        /// Delete an existing payment method user group.
        /// </summary>
        /// <param name="paymentMethodUserGroupId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string paymentMethodUserGroupId)
        {
             var urlTemplate = "Txn/PaymentMethodUserGroups/{0}";
             urlTemplate = string.Format(urlTemplate, paymentMethodUserGroupId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PaymentMethodUserGroupsFacadeBatch
    {
        private IRestClient restClient;

        public PaymentMethodUserGroupsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(Decimal? amount = null, string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentMethodUserGroups";
            bRequest.Content = null;

            var urlTemplate = "Txn/PaymentMethodUserGroups/?amount={0}&maintenanceMode={1}";
            urlTemplate = string.Format(urlTemplate, amount,maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a payment method user group.
        /// </summary>
        /// <param name="paymentMethodUserGroupId"></param>
        /// <returns></returns>
        public Request Get(string paymentMethodUserGroupId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentMethodUserGroup";
            bRequest.Content = null;

            var urlTemplate = "Txn/PaymentMethodUserGroups/{0}";
            urlTemplate = string.Format(urlTemplate, paymentMethodUserGroupId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new payment method user group.
        /// </summary>
        /// <param name="paymentMethodUserGroup"></param>
        /// <returns></returns>
        public Request Create(PaymentMethodUserGroup paymentMethodUserGroup, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentMethodUserGroup";
            bRequest.Content = paymentMethodUserGroup;

            bRequest.Uri = restClient.GetBaseUrl() + "Txn/PaymentMethodUserGroups/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing payment method user group.
        /// </summary>
        /// <param name="paymentMethodUserGroupId"></param>
        /// <param name="paymentMethodUserGroup"></param>
        /// <returns></returns>
        public Request Update(string paymentMethodUserGroupId, PaymentMethodUserGroup paymentMethodUserGroup, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentMethodUserGroup";
            bRequest.Content = paymentMethodUserGroup;

            var urlTemplate = "Txn/PaymentMethodUserGroups/{0}";
            urlTemplate = string.Format(urlTemplate, paymentMethodUserGroupId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing payment method user group.
        /// </summary>
        /// <param name="paymentMethodUserGroupId"></param>
        public Request Delete(string paymentMethodUserGroupId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Txn/PaymentMethodUserGroups/{0}";
            urlTemplate = string.Format(urlTemplate, paymentMethodUserGroupId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// <summary></summary>
    public class PaymentsFacade
    {
        private IRestClient restClient;

        public PaymentsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get a single payment.
        /// </summary>
        /// <returns></returns>
        public async Task<RestResponse<Payment>> Get(Int32 id)
        {
             var urlTemplate = "TXN/Payments/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Get<Payment>();
        }

        /// <summary>
        /// Get payments for a specified referenceId (order or contribution id).
        /// </summary>
        /// <param name="referenceId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Payments>> GetAll(string referenceId = "")
        {
            var urlTemplate = "TXN/Payments/?referenceId={0}";
            urlTemplate = string.Format(urlTemplate, referenceId);
            return await restClient.AtUrl(urlTemplate).Get<Payments>();
        }

        /// <summary>
        /// Retrieve cc payments available for refund by processor reference number
        /// </summary>
        /// <returns></returns>
        public async Task<RestResponse<PaymentsAvailableForRefund>> AvailableForRefund(string orderIdsOrContributionIds = "null")
        {
            var urlTemplate = "TXN/Payments/AvailableForRefund?orderIdsOrContributionIds={0}";
            urlTemplate = string.Format(urlTemplate, orderIdsOrContributionIds);
            return await restClient.AtUrl(urlTemplate).Get<PaymentsAvailableForRefund>();
        }

        /// <summary></summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<PaymentReserveIdResponse>> ReserveIds(PaymentReserveIdRequest request)
        {
            return await restClient.AtUrl("TXN/Payments/ReserveIds").Post<PaymentReserveIdRequest, PaymentReserveIdResponse>(request);
        }

        /// <summary>
        /// Gets a constituent's on-account balance for the specified payment method
        /// </summary>
        public async Task<RestResponse<OnAccountResponse>> GetOnAccountBalance(Int32 constituentId, Int32 paymentMethodId)
        {
            var urlTemplate = "TXN/Payments/OnAccount?constituentId={0}&paymentMethodId={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,paymentMethodId);
            return await restClient.AtUrl(urlTemplate).Get<OnAccountResponse>();
        }

    }
 

 
    /// <summary></summary>
    public class PaymentsFacadeBatch
    {
        private IRestClient restClient;

        public PaymentsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get a single payment.
        /// </summary>
        /// <returns></returns>
        public Request Get(Int32 id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Payment";
            bRequest.Content = null;

            var urlTemplate = "TXN/Payments/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get payments for a specified referenceId (order or contribution id).
        /// </summary>
        /// <param name="referenceId"></param>
        /// <returns></returns>
        public Request GetAll(string referenceId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Payments";
            bRequest.Content = null;

            var urlTemplate = "TXN/Payments/?referenceId={0}";
            urlTemplate = string.Format(urlTemplate, referenceId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Retrieve cc payments available for refund by processor reference number
        /// </summary>
        /// <returns></returns>
        public Request AvailableForRefund(string orderIdsOrContributionIds = "null", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentsAvailableForRefund";
            bRequest.Content = null;

            var urlTemplate = "TXN/Payments/AvailableForRefund?orderIdsOrContributionIds={0}";
            urlTemplate = string.Format(urlTemplate, orderIdsOrContributionIds);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary></summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request ReserveIds(PaymentReserveIdRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentReserveIdResponse";
            bRequest.Content = request;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/Payments/ReserveIds";

            return bRequest;
        }

        /// <summary>
        /// Gets a constituent's on-account balance for the specified payment method
        /// </summary>
        public Request GetOnAccountBalance(Int32 constituentId, Int32 paymentMethodId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.OnAccountResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/Payments/OnAccount?constituentId={0}&paymentMethodId={1}";
            urlTemplate = string.Format(urlTemplate, constituentId,paymentMethodId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PaymentSignaturesFacade
    {
        private IRestClient restClient;

        public PaymentSignaturesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all payment signatures.
        /// </summary>
        /// <returns></returns>
        public async Task<RestResponse<PaymentSignatures>> GetAll(string paymentId = "null")
        {
            var urlTemplate = "TXN/Payment/Signatures/?paymentId={0}";
            urlTemplate = string.Format(urlTemplate, paymentId);
            return await restClient.AtUrl(urlTemplate).Get<PaymentSignatures>();
        }

        /// <summary>
        /// Get details of a payment signature.
        /// </summary>
        /// <param name="paymentSignatureId"></param>
        /// <returns></returns>
        public async Task<RestResponse<PaymentSignature>> Get(string paymentSignatureId = "")
        {
             var urlTemplate = "TXN/Payment/Signatures/{0}";
             urlTemplate = string.Format(urlTemplate, paymentSignatureId);
            return await restClient.AtUrl(urlTemplate).Get<PaymentSignature>();
        }

        /// <summary>
        /// Create a new payment signature.
        /// </summary>
        /// <param name="paymentSignature"></param>
        /// <returns></returns>
        public async Task<RestResponse<PaymentSignature>> Create(PaymentSignature paymentSignature)
        {
            return await restClient.AtUrl("TXN/Payment/Signatures/").Post<PaymentSignature, PaymentSignature>(paymentSignature);
        }

        /// <summary>
        /// Update an existing payment signature.
        /// </summary>
        /// <param name="paymentSignatureId"></param>
        /// <param name="paymentSignature"></param>
        /// <returns></returns>
        public async Task<RestResponse<PaymentSignature>> Update(string paymentSignatureId, PaymentSignature paymentSignature)
        {
             var urlTemplate = "TXN/Payment/Signatures/{0}";
             urlTemplate = string.Format(urlTemplate, paymentSignatureId);
            return await restClient.AtUrl(urlTemplate).Put<PaymentSignature, PaymentSignature>(paymentSignature);
        }

        /// <summary>
        /// Delete an existing payment signature.
        /// </summary>
        /// <param name="paymentSignatureId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string paymentSignatureId)
        {
             var urlTemplate = "TXN/Payment/Signatures/{0}";
             urlTemplate = string.Format(urlTemplate, paymentSignatureId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Create a new payment signature.
        /// </summary>
        /// <param name="orderId"></param>
        /// <param name="paymentSignature"></param>
        /// <returns></returns>
        public async Task<RestResponse<PaymentSignature>> PostForOrder(Int32 orderId, PaymentSignature paymentSignature)
        {
             var urlTemplate = "TXN/Payment/Signatures/Order/{0}";
             urlTemplate = string.Format(urlTemplate, orderId);
            return await restClient.AtUrl(urlTemplate).Post<PaymentSignature, PaymentSignature>(paymentSignature);
        }

    }
 

 
    /// 
    public class PaymentSignaturesFacadeBatch
    {
        private IRestClient restClient;

        public PaymentSignaturesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all payment signatures.
        /// </summary>
        /// <returns></returns>
        public Request GetAll(string paymentId = "null", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentSignatures";
            bRequest.Content = null;

            var urlTemplate = "TXN/Payment/Signatures/?paymentId={0}";
            urlTemplate = string.Format(urlTemplate, paymentId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a payment signature.
        /// </summary>
        /// <param name="paymentSignatureId"></param>
        /// <returns></returns>
        public Request Get(string paymentSignatureId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentSignature";
            bRequest.Content = null;

            var urlTemplate = "TXN/Payment/Signatures/{0}";
            urlTemplate = string.Format(urlTemplate, paymentSignatureId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new payment signature.
        /// </summary>
        /// <param name="paymentSignature"></param>
        /// <returns></returns>
        public Request Create(PaymentSignature paymentSignature, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentSignature";
            bRequest.Content = paymentSignature;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/Payment/Signatures/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing payment signature.
        /// </summary>
        /// <param name="paymentSignatureId"></param>
        /// <param name="paymentSignature"></param>
        /// <returns></returns>
        public Request Update(string paymentSignatureId, PaymentSignature paymentSignature, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentSignature";
            bRequest.Content = paymentSignature;

            var urlTemplate = "TXN/Payment/Signatures/{0}";
            urlTemplate = string.Format(urlTemplate, paymentSignatureId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing payment signature.
        /// </summary>
        /// <param name="paymentSignatureId"></param>
        public Request Delete(string paymentSignatureId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/Payment/Signatures/{0}";
            urlTemplate = string.Format(urlTemplate, paymentSignatureId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new payment signature.
        /// </summary>
        /// <param name="orderId"></param>
        /// <param name="paymentSignature"></param>
        /// <returns></returns>
        public Request PostForOrder(Int32 orderId, PaymentSignature paymentSignature, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentSignature";
            bRequest.Content = paymentSignature;

            var urlTemplate = "TXN/Payment/Signatures/Order/{0}";
            urlTemplate = string.Format(urlTemplate, orderId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PerformanceGroupsFacade
    {
        private IRestClient restClient;

        public PerformanceGroupsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all performance groups.
        /// </summary>
        /// <param name="seasonId"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformanceGroups>> GetAll(string seasonId = "")
        {
            var urlTemplate = "TXN/PerformanceGroups/?seasonId={0}";
            urlTemplate = string.Format(urlTemplate, seasonId);
            return await restClient.AtUrl(urlTemplate).Get<PerformanceGroups>();
        }

        /// <summary>
        /// Get a summary representation of all performance groups.
        /// </summary>
        /// <param name="seasonId"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformanceGroupSummaries>> GetSummaries(string seasonId = "")
        {
            var urlTemplate = "TXN/PerformanceGroups/Summary?seasonId={0}";
            urlTemplate = string.Format(urlTemplate, seasonId);
            return await restClient.AtUrl(urlTemplate).Get<PerformanceGroupSummaries>();
        }

        /// <summary>
        /// Get details of a Performance Group.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformanceGroup>> Get(string id = "")
        {
             var urlTemplate = "TXN/PerformanceGroups/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Get<PerformanceGroup>();
        }

        /// <summary>
        /// Create a new Performance Group.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformanceGroup>> Create(PerformanceGroup data)
        {
            return await restClient.AtUrl("TXN/PerformanceGroups/").Post<PerformanceGroup, PerformanceGroup>(data);
        }

        /// <summary>
        /// Update a Performance Group.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="performanceGroup"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformanceGroup>> Update(string id, PerformanceGroup performanceGroup)
        {
             var urlTemplate = "TXN/PerformanceGroups/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<PerformanceGroup, PerformanceGroup>(performanceGroup);
        }

        /// <summary>
        /// Delete a specific performance group.
        /// </summary>
        /// <param name="id"></param>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "TXN/PerformanceGroups/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PerformanceGroupsFacadeBatch
    {
        private IRestClient restClient;

        public PerformanceGroupsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all performance groups.
        /// </summary>
        /// <param name="seasonId"></param>
        /// <returns></returns>
        public Request GetAll(string seasonId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformanceGroups";
            bRequest.Content = null;

            var urlTemplate = "TXN/PerformanceGroups/?seasonId={0}";
            urlTemplate = string.Format(urlTemplate, seasonId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get a summary representation of all performance groups.
        /// </summary>
        /// <param name="seasonId"></param>
        /// <returns></returns>
        public Request GetSummaries(string seasonId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformanceGroupSummaries";
            bRequest.Content = null;

            var urlTemplate = "TXN/PerformanceGroups/Summary?seasonId={0}";
            urlTemplate = string.Format(urlTemplate, seasonId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a Performance Group.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformanceGroup";
            bRequest.Content = null;

            var urlTemplate = "TXN/PerformanceGroups/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new Performance Group.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(PerformanceGroup data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformanceGroup";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PerformanceGroups/";

            return bRequest;
        }

        /// <summary>
        /// Update a Performance Group.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="performanceGroup"></param>
        /// <returns></returns>
        public Request Update(string id, PerformanceGroup performanceGroup, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformanceGroup";
            bRequest.Content = performanceGroup;

            var urlTemplate = "TXN/PerformanceGroups/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete a specific performance group.
        /// </summary>
        /// <param name="id"></param>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/PerformanceGroups/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PerformancePackageModeOfSalesFacade
    {
        private IRestClient restClient;

        public PerformancePackageModeOfSalesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<PerformancePackageModeOfSales>> GetAll()
        {
            return await restClient.AtUrl("TXN/PerformancePackageModeOfSales/").Get<PerformancePackageModeOfSales>();
        }

        /// <summary>
        /// Get details of a performance package mode of sale.
        /// </summary>
        /// <param name="performancePackageModeOfSaleId"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformancePackageModeOfSale>> Get(string performancePackageModeOfSaleId = "")
        {
             var urlTemplate = "TXN/PerformancePackageModeOfSales/{0}";
             urlTemplate = string.Format(urlTemplate, performancePackageModeOfSaleId);
            return await restClient.AtUrl(urlTemplate).Get<PerformancePackageModeOfSale>();
        }

        /// <summary>
        /// Create a new performance package mode of sale.
        /// </summary>
        /// <param name="performancePackageModeOfSale"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformancePackageModeOfSale>> Create(PerformancePackageModeOfSale performancePackageModeOfSale)
        {
            return await restClient.AtUrl("TXN/PerformancePackageModeOfSales/").Post<PerformancePackageModeOfSale, PerformancePackageModeOfSale>(performancePackageModeOfSale);
        }

        /// <summary>
        /// Update an existing performance package mode of sale.
        /// </summary>
        /// <param name="performancePackageModeOfSaleId"></param>
        /// <param name="performancePackageModeOfSale"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformancePackageModeOfSale>> Update(string performancePackageModeOfSaleId, PerformancePackageModeOfSale performancePackageModeOfSale)
        {
             var urlTemplate = "TXN/PerformancePackageModeOfSales/{0}";
             urlTemplate = string.Format(urlTemplate, performancePackageModeOfSaleId);
            return await restClient.AtUrl(urlTemplate).Put<PerformancePackageModeOfSale, PerformancePackageModeOfSale>(performancePackageModeOfSale);
        }

        /// <summary>
        /// Delete an existing performance package mode of sale.
        /// </summary>
        /// <param name="performancePackageModeOfSaleId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string performancePackageModeOfSaleId)
        {
             var urlTemplate = "TXN/PerformancePackageModeOfSales/{0}";
             urlTemplate = string.Format(urlTemplate, performancePackageModeOfSaleId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PerformancePackageModeOfSalesFacadeBatch
    {
        private IRestClient restClient;

        public PerformancePackageModeOfSalesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformancePackageModeOfSales";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PerformancePackageModeOfSales/";

            return bRequest;
        }

        /// <summary>
        /// Get details of a performance package mode of sale.
        /// </summary>
        /// <param name="performancePackageModeOfSaleId"></param>
        /// <returns></returns>
        public Request Get(string performancePackageModeOfSaleId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformancePackageModeOfSale";
            bRequest.Content = null;

            var urlTemplate = "TXN/PerformancePackageModeOfSales/{0}";
            urlTemplate = string.Format(urlTemplate, performancePackageModeOfSaleId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new performance package mode of sale.
        /// </summary>
        /// <param name="performancePackageModeOfSale"></param>
        /// <returns></returns>
        public Request Create(PerformancePackageModeOfSale performancePackageModeOfSale, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformancePackageModeOfSale";
            bRequest.Content = performancePackageModeOfSale;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PerformancePackageModeOfSales/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing performance package mode of sale.
        /// </summary>
        /// <param name="performancePackageModeOfSaleId"></param>
        /// <param name="performancePackageModeOfSale"></param>
        /// <returns></returns>
        public Request Update(string performancePackageModeOfSaleId, PerformancePackageModeOfSale performancePackageModeOfSale, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformancePackageModeOfSale";
            bRequest.Content = performancePackageModeOfSale;

            var urlTemplate = "TXN/PerformancePackageModeOfSales/{0}";
            urlTemplate = string.Format(urlTemplate, performancePackageModeOfSaleId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing performance package mode of sale.
        /// </summary>
        /// <param name="performancePackageModeOfSaleId"></param>
        public Request Delete(string performancePackageModeOfSaleId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/PerformancePackageModeOfSales/{0}";
            urlTemplate = string.Format(urlTemplate, performancePackageModeOfSaleId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PerformancePriceLayersFacade
    {
        private IRestClient restClient;

        public PerformancePriceLayersFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all performance price layers for the list of performances. Only one of AsOfDateTime or AsOfRelativeDate can be specified to get prices effective for that date time.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformancePriceLayers>> Search(PerformancePriceLayerSearchRequest request)
        {
            return await restClient.AtUrl("TXN/PerformancePriceLayers/Search").Post<PerformancePriceLayerSearchRequest, PerformancePriceLayers>(request);
        }

        /// <summary>
        /// Get count of performance price layers for a set of performances.
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformancePriceLayerCounts>> GetCounts(string performanceIds = "")
        {
            var urlTemplate = "TXN/PerformancePriceLayers/Count?performanceIds={0}";
            urlTemplate = string.Format(urlTemplate, performanceIds);
            return await restClient.AtUrl(urlTemplate).Get<PerformancePriceLayerCounts>();
        }

        /// <summary>
        /// Get details of a performance price layer.
        /// </summary>
        /// <param name="performancePriceLayerId"></param>
        /// <param name="asOfDateTime"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformancePriceLayer>> Get(string performancePriceLayerId = "", string asOfDateTime = "")
        {
             var urlTemplate = "TXN/PerformancePriceLayers/{0}?asOfDateTime={1}";
             urlTemplate = string.Format(urlTemplate, performancePriceLayerId, asOfDateTime);
            return await restClient.AtUrl(urlTemplate).Get<PerformancePriceLayer>();
        }

        /// <summary>
        /// Create a new performance price layer.
        /// </summary>
        /// <param name="performancePriceLayer"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformancePriceLayer>> Create(PerformancePriceLayer performancePriceLayer)
        {
            return await restClient.AtUrl("TXN/PerformancePriceLayers/").Post<PerformancePriceLayer, PerformancePriceLayer>(performancePriceLayer);
        }

        /// <summary>
        /// Update an existing performance price layer.
        /// </summary>
        /// <param name="performancePriceLayerId"></param>
        /// <param name="performancePriceLayer"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformancePriceLayer>> Update(string performancePriceLayerId, PerformancePriceLayer performancePriceLayer)
        {
             var urlTemplate = "TXN/PerformancePriceLayers/{0}";
             urlTemplate = string.Format(urlTemplate, performancePriceLayerId);
            return await restClient.AtUrl(urlTemplate).Put<PerformancePriceLayer, PerformancePriceLayer>(performancePriceLayer);
        }

        /// <summary>
        /// Update a set of prices across one or more performances.
        /// </summary>
        /// <param name="priceUpdateRequests"></param>
        public async Task<RestResponse<NoResponse>> UpdatePrices(PriceUpdateRequests priceUpdateRequests)
        {
            return await restClient.AtUrl("TXN/PerformancePriceLayers/Prices").Put<PriceUpdateRequests, NoResponse>(priceUpdateRequests);
        }

        /// <summary>
        /// Delete performance price layers for a set of performances and layer type.
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <param name="priceLayerTypeId"></param>
        public async Task<RestResponse<NoResponse>> DeleteLayers(string performanceIds, string priceLayerTypeId)
        {
            return await restClient.AtUrl("TXN/PerformancePriceLayers/?PerformanceIds=performanceIds&PriceLayerTypeId=priceLayerTypeId").Delete();
        }

        /// <summary>
        /// Delete an existing performance price layer.
        /// </summary>
        /// <param name="performancePriceLayerId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string performancePriceLayerId)
        {
             var urlTemplate = "TXN/PerformancePriceLayers/{0}";
             urlTemplate = string.Format(urlTemplate, performancePriceLayerId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Gets the total count of price objects that will be collected when calling for the full price layer contract on these performanceIds.
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformancePriceCount>> GetPriceCount(string performanceIds = "")
        {
            var urlTemplate = "TXN/PerformancePriceLayers/PriceCount?performanceIds={0}";
            urlTemplate = string.Format(urlTemplate, performanceIds);
            return await restClient.AtUrl(urlTemplate).Get<PerformancePriceCount>();
        }

        /// <summary>
        /// Get all performance price layers for the list of performances. Only one of AsOfDateTime or AsOfRelativeDate can be specified to get prices effective for that date time.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformancePriceResponse>> SearchSummaries(PerformancePriceLayerSearchRequest request)
        {
            return await restClient.AtUrl("TXN/PerformancePriceLayers/Summaries/Search").Post<PerformancePriceLayerSearchRequest, PerformancePriceResponse>(request);
        }

        /// <summary>
        /// Create/Update the prices for a set of performances.
        /// </summary>
        /// <param name="layers"></param>
        public async Task<RestResponse<NoResponse>> PostSummaries(PerformancePriceLayerSummaries layers)
        {
            return await restClient.AtUrl("TXN/PerformancePriceLayers/Summaries").Post<PerformancePriceLayerSummaries, NoResponse>(layers);
        }

    }
 

 
    /// 
    public class PerformancePriceLayersFacadeBatch
    {
        private IRestClient restClient;

        public PerformancePriceLayersFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all performance price layers for the list of performances. Only one of AsOfDateTime or AsOfRelativeDate can be specified to get prices effective for that date time.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request Search(PerformancePriceLayerSearchRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformancePriceLayers";
            bRequest.Content = request;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PerformancePriceLayers/Search";

            return bRequest;
        }

        /// <summary>
        /// Get count of performance price layers for a set of performances.
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <returns></returns>
        public Request GetCounts(string performanceIds = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformancePriceLayerCounts";
            bRequest.Content = null;

            var urlTemplate = "TXN/PerformancePriceLayers/Count?performanceIds={0}";
            urlTemplate = string.Format(urlTemplate, performanceIds);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a performance price layer.
        /// </summary>
        /// <param name="performancePriceLayerId"></param>
        /// <param name="asOfDateTime"></param>
        /// <returns></returns>
        public Request Get(string performancePriceLayerId = "", string asOfDateTime = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformancePriceLayer";
            bRequest.Content = null;

            var urlTemplate = "TXN/PerformancePriceLayers/{0}?asOfDateTime={1}";
            urlTemplate = string.Format(urlTemplate, performancePriceLayerId, asOfDateTime);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new performance price layer.
        /// </summary>
        /// <param name="performancePriceLayer"></param>
        /// <returns></returns>
        public Request Create(PerformancePriceLayer performancePriceLayer, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformancePriceLayer";
            bRequest.Content = performancePriceLayer;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PerformancePriceLayers/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing performance price layer.
        /// </summary>
        /// <param name="performancePriceLayerId"></param>
        /// <param name="performancePriceLayer"></param>
        /// <returns></returns>
        public Request Update(string performancePriceLayerId, PerformancePriceLayer performancePriceLayer, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformancePriceLayer";
            bRequest.Content = performancePriceLayer;

            var urlTemplate = "TXN/PerformancePriceLayers/{0}";
            urlTemplate = string.Format(urlTemplate, performancePriceLayerId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Update a set of prices across one or more performances.
        /// </summary>
        /// <param name="priceUpdateRequests"></param>
        public Request UpdatePrices(PriceUpdateRequests priceUpdateRequests, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = priceUpdateRequests;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PerformancePriceLayers/Prices";

            return bRequest;
        }

        /// <summary>
        /// Delete performance price layers for a set of performances and layer type.
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <param name="priceLayerTypeId"></param>
        public Request DeleteLayers(string performanceIds, string priceLayerTypeId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PerformancePriceLayers/";

            return bRequest;
        }

        /// <summary>
        /// Delete an existing performance price layer.
        /// </summary>
        /// <param name="performancePriceLayerId"></param>
        public Request Delete(string performancePriceLayerId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/PerformancePriceLayers/{0}";
            urlTemplate = string.Format(urlTemplate, performancePriceLayerId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Gets the total count of price objects that will be collected when calling for the full price layer contract on these performanceIds.
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <returns></returns>
        public Request GetPriceCount(string performanceIds = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformancePriceCount";
            bRequest.Content = null;

            var urlTemplate = "TXN/PerformancePriceLayers/PriceCount?performanceIds={0}";
            urlTemplate = string.Format(urlTemplate, performanceIds);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get all performance price layers for the list of performances. Only one of AsOfDateTime or AsOfRelativeDate can be specified to get prices effective for that date time.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request SearchSummaries(PerformancePriceLayerSearchRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformancePriceResponse";
            bRequest.Content = request;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PerformancePriceLayers/Summaries/Search";

            return bRequest;
        }

        /// <summary>
        /// Create/Update the prices for a set of performances.
        /// </summary>
        /// <param name="layers"></param>
        public Request PostSummaries(PerformancePriceLayerSummaries layers, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = layers;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PerformancePriceLayers/Summaries";

            return bRequest;
        }

    }
 

 
    /// 
    public class PerformancePricesFacade
    {
        private IRestClient restClient;

        public PerformancePricesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all performance prices for a set of performance price types. Pass in asOfDateTime to get prices effective for that date/time.
        /// </summary>
        /// <param name="performancePriceTypeIds"></param>
        /// <param name="asOfDateTime"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformancePrices>> GetAll(string performancePriceTypeIds = "", string asOfDateTime = "")
        {
            var urlTemplate = "TXN/PerformancePrices/?performancePriceTypeIds={0}&asOfDateTime={1}";
            urlTemplate = string.Format(urlTemplate, performancePriceTypeIds,asOfDateTime);
            return await restClient.AtUrl(urlTemplate).Get<PerformancePrices>();
        }

        /// <summary>
        /// Get the performance price audit entries for a set of performance prices.
        /// </summary>
        /// <param name="performancePriceIds"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformancePriceAuditEntries>> GetAudit(string performancePriceIds = "")
        {
            var urlTemplate = "TXN/PerformancePrices/Audit?performancePriceIds={0}";
            urlTemplate = string.Format(urlTemplate, performancePriceIds);
            return await restClient.AtUrl(urlTemplate).Get<PerformancePriceAuditEntries>();
        }

        /// <summary>
        /// Get details of a set of performance prices along with events associated with those prices.
        /// </summary>
        /// <param name="performancePriceIds"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformancePriceDetails>> GetAllWithEvents(string performancePriceIds = "")
        {
            var urlTemplate = "TXN/PerformancePrices/Details/?performancePriceIds={0}";
            urlTemplate = string.Format(urlTemplate, performancePriceIds);
            return await restClient.AtUrl(urlTemplate).Get<PerformancePriceDetails>();
        }

        /// <summary>
        /// Get details of a performance price.
        /// </summary>
        /// <param name="performancePriceId"></param>
        /// <param name="asOfDateTime"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformancePrice>> Get(string performancePriceId = "", string asOfDateTime = "")
        {
             var urlTemplate = "TXN/PerformancePrices/{0}?asOfDateTime={1}";
             urlTemplate = string.Format(urlTemplate, performancePriceId, asOfDateTime);
            return await restClient.AtUrl(urlTemplate).Get<PerformancePrice>();
        }

        /// <summary>
        /// Create a new performance price.
        /// </summary>
        /// <param name="performancePrice"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformancePrice>> Create(PerformancePrice performancePrice)
        {
            return await restClient.AtUrl("TXN/PerformancePrices/").Post<PerformancePrice, PerformancePrice>(performancePrice);
        }

        /// <summary>
        /// Update an existing performance price.
        /// </summary>
        /// <param name="performancePriceId"></param>
        /// <param name="performancePrice"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformancePrice>> Update(string performancePriceId, PerformancePrice performancePrice)
        {
             var urlTemplate = "TXN/PerformancePrices/{0}";
             urlTemplate = string.Format(urlTemplate, performancePriceId);
            return await restClient.AtUrl(urlTemplate).Put<PerformancePrice, PerformancePrice>(performancePrice);
        }

        /// <summary>
        /// Delete an existing performance price.
        /// </summary>
        /// <param name="performancePriceId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string performancePriceId)
        {
             var urlTemplate = "TXN/PerformancePrices/{0}";
             urlTemplate = string.Format(urlTemplate, performancePriceId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PerformancePricesFacadeBatch
    {
        private IRestClient restClient;

        public PerformancePricesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all performance prices for a set of performance price types. Pass in asOfDateTime to get prices effective for that date/time.
        /// </summary>
        /// <param name="performancePriceTypeIds"></param>
        /// <param name="asOfDateTime"></param>
        /// <returns></returns>
        public Request GetAll(string performancePriceTypeIds = "", string asOfDateTime = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformancePrices";
            bRequest.Content = null;

            var urlTemplate = "TXN/PerformancePrices/?performancePriceTypeIds={0}&asOfDateTime={1}";
            urlTemplate = string.Format(urlTemplate, performancePriceTypeIds,asOfDateTime);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get the performance price audit entries for a set of performance prices.
        /// </summary>
        /// <param name="performancePriceIds"></param>
        /// <returns></returns>
        public Request GetAudit(string performancePriceIds = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformancePriceAuditEntries";
            bRequest.Content = null;

            var urlTemplate = "TXN/PerformancePrices/Audit?performancePriceIds={0}";
            urlTemplate = string.Format(urlTemplate, performancePriceIds);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a set of performance prices along with events associated with those prices.
        /// </summary>
        /// <param name="performancePriceIds"></param>
        /// <returns></returns>
        public Request GetAllWithEvents(string performancePriceIds = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformancePriceDetails";
            bRequest.Content = null;

            var urlTemplate = "TXN/PerformancePrices/Details/?performancePriceIds={0}";
            urlTemplate = string.Format(urlTemplate, performancePriceIds);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a performance price.
        /// </summary>
        /// <param name="performancePriceId"></param>
        /// <param name="asOfDateTime"></param>
        /// <returns></returns>
        public Request Get(string performancePriceId = "", string asOfDateTime = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformancePrice";
            bRequest.Content = null;

            var urlTemplate = "TXN/PerformancePrices/{0}?asOfDateTime={1}";
            urlTemplate = string.Format(urlTemplate, performancePriceId, asOfDateTime);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new performance price.
        /// </summary>
        /// <param name="performancePrice"></param>
        /// <returns></returns>
        public Request Create(PerformancePrice performancePrice, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformancePrice";
            bRequest.Content = performancePrice;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PerformancePrices/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing performance price.
        /// </summary>
        /// <param name="performancePriceId"></param>
        /// <param name="performancePrice"></param>
        /// <returns></returns>
        public Request Update(string performancePriceId, PerformancePrice performancePrice, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformancePrice";
            bRequest.Content = performancePrice;

            var urlTemplate = "TXN/PerformancePrices/{0}";
            urlTemplate = string.Format(urlTemplate, performancePriceId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing performance price.
        /// </summary>
        /// <param name="performancePriceId"></param>
        public Request Delete(string performancePriceId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/PerformancePrices/{0}";
            urlTemplate = string.Format(urlTemplate, performancePriceId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PerformancePriceTypesFacade
    {
        private IRestClient restClient;

        public PerformancePriceTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all performance price type for the list of performances. (Pass comma separated list of performance Ids as parameter)
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <param name="priceTypeIds"></param>
        /// <param name="asOfDateTime"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformancePriceTypes>> GetAll(string performanceIds = "", string priceTypeIds = "", string asOfDateTime = "")
        {
            var urlTemplate = "TXN/PerformancePriceTypes/?performanceIds={0}&priceTypeIds={1}&asOfDateTime={2}";
            urlTemplate = string.Format(urlTemplate, performanceIds,priceTypeIds,asOfDateTime);
            return await restClient.AtUrl(urlTemplate).Get<PerformancePriceTypes>();
        }

        /// <summary>
        /// Get details of a performance price type.
        /// </summary>
        /// <param name="performancePriceTypeId"></param>
        /// <param name="asOfDateTime"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformancePriceType>> Get(string performancePriceTypeId = "", string asOfDateTime = "")
        {
             var urlTemplate = "TXN/PerformancePriceTypes/{0}?asOfDateTime={1}";
             urlTemplate = string.Format(urlTemplate, performancePriceTypeId, asOfDateTime);
            return await restClient.AtUrl(urlTemplate).Get<PerformancePriceType>();
        }

        /// <summary>
        /// Create a new performance price type.
        /// </summary>
        /// <param name="performancePriceType"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformancePriceType>> Create(PerformancePriceType performancePriceType)
        {
            return await restClient.AtUrl("TXN/PerformancePriceTypes/").Post<PerformancePriceType, PerformancePriceType>(performancePriceType);
        }

        /// <summary>
        /// Update the performance price types for a set of performances.
        /// </summary>
        /// <param name="performancePriceType"></param>
        public async Task<RestResponse<NoResponse>> BulkUpdate(PerformancePriceTypeUpdateRequests performancePriceType)
        {
            return await restClient.AtUrl("TXN/PerformancePriceTypes/").Put<PerformancePriceTypeUpdateRequests, NoResponse>(performancePriceType);
        }

        /// <summary>
        /// Update an existing performance price type.
        /// </summary>
        /// <param name="performancePriceTypeId"></param>
        /// <param name="performancePriceType"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformancePriceType>> Update(string performancePriceTypeId, PerformancePriceType performancePriceType)
        {
             var urlTemplate = "TXN/PerformancePriceTypes/{0}";
             urlTemplate = string.Format(urlTemplate, performancePriceTypeId);
            return await restClient.AtUrl(urlTemplate).Put<PerformancePriceType, PerformancePriceType>(performancePriceType);
        }

        /// <summary>
        /// Update base indicator on performance price types for a set of performances and price type.
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <param name="priceTypeId"></param>
        /// <param name="priceLayerTypeIds"></param>
        public async Task<RestResponse<NoResponse>> UpdateBase(string performanceIds, string priceTypeId = "", string priceLayerTypeIds = "")
        {
            return await restClient.AtUrl("TXN/PerformancePriceTypes/Base/").Put<string, NoResponse>(priceLayerTypeIds);
        }

        /// <summary>
        /// Delete an existing performance price type.
        /// </summary>
        /// <param name="performancePriceTypeId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string performancePriceTypeId)
        {
             var urlTemplate = "TXN/PerformancePriceTypes/{0}";
             urlTemplate = string.Format(urlTemplate, performancePriceTypeId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Delete all performance price types for a set of performance and price layer types and price types.
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <param name="priceLayerTypeIds"></param>
        /// <param name="priceTypeIds"></param>
        public async Task<RestResponse<NoResponse>> DeleteAll(string performanceIds, string priceLayerTypeIds = "", string priceTypeIds = "")
        {
            return await restClient.AtUrl("TXN/PerformancePriceTypes/?PerformanceIds=performanceIds&PriceLayerTypeIds=priceLayerTypeIds&PriceTypeIds=priceTypeIds").Delete();
        }

    }
 

 
    /// 
    public class PerformancePriceTypesFacadeBatch
    {
        private IRestClient restClient;

        public PerformancePriceTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all performance price type for the list of performances. (Pass comma separated list of performance Ids as parameter)
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <param name="priceTypeIds"></param>
        /// <param name="asOfDateTime"></param>
        /// <returns></returns>
        public Request GetAll(string performanceIds = "", string priceTypeIds = "", string asOfDateTime = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformancePriceTypes";
            bRequest.Content = null;

            var urlTemplate = "TXN/PerformancePriceTypes/?performanceIds={0}&priceTypeIds={1}&asOfDateTime={2}";
            urlTemplate = string.Format(urlTemplate, performanceIds,priceTypeIds,asOfDateTime);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a performance price type.
        /// </summary>
        /// <param name="performancePriceTypeId"></param>
        /// <param name="asOfDateTime"></param>
        /// <returns></returns>
        public Request Get(string performancePriceTypeId = "", string asOfDateTime = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformancePriceType";
            bRequest.Content = null;

            var urlTemplate = "TXN/PerformancePriceTypes/{0}?asOfDateTime={1}";
            urlTemplate = string.Format(urlTemplate, performancePriceTypeId, asOfDateTime);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new performance price type.
        /// </summary>
        /// <param name="performancePriceType"></param>
        /// <returns></returns>
        public Request Create(PerformancePriceType performancePriceType, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformancePriceType";
            bRequest.Content = performancePriceType;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PerformancePriceTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update the performance price types for a set of performances.
        /// </summary>
        /// <param name="performancePriceType"></param>
        public Request BulkUpdate(PerformancePriceTypeUpdateRequests performancePriceType, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = performancePriceType;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PerformancePriceTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing performance price type.
        /// </summary>
        /// <param name="performancePriceTypeId"></param>
        /// <param name="performancePriceType"></param>
        /// <returns></returns>
        public Request Update(string performancePriceTypeId, PerformancePriceType performancePriceType, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformancePriceType";
            bRequest.Content = performancePriceType;

            var urlTemplate = "TXN/PerformancePriceTypes/{0}";
            urlTemplate = string.Format(urlTemplate, performancePriceTypeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Update base indicator on performance price types for a set of performances and price type.
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <param name="priceTypeId"></param>
        /// <param name="priceLayerTypeIds"></param>
        public Request UpdateBase(string performanceIds, string priceTypeId = "", string priceLayerTypeIds = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = priceLayerTypeIds;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PerformancePriceTypes/Base/";

            return bRequest;
        }

        /// <summary>
        /// Delete an existing performance price type.
        /// </summary>
        /// <param name="performancePriceTypeId"></param>
        public Request Delete(string performancePriceTypeId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/PerformancePriceTypes/{0}";
            urlTemplate = string.Format(urlTemplate, performancePriceTypeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete all performance price types for a set of performance and price layer types and price types.
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <param name="priceLayerTypeIds"></param>
        /// <param name="priceTypeIds"></param>
        public Request DeleteAll(string performanceIds, string priceLayerTypeIds = "", string priceTypeIds = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PerformancePriceTypes/";

            return bRequest;
        }

    }
 

 
    /// 
    public class PerformancesFacade
    {
        private IRestClient restClient;

        public PerformancesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get performance detail information
        /// For single production season, a comma separated list of performance ids and/or single seasonId.
        /// </summary>
        /// <param name="performanceIds">One or more performance IDs</param>
        /// <param name="seasonId"></param>
        /// <param name="productionSeasonId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Performances>> GetAll(string performanceIds = "", string seasonId = "", string productionSeasonId = "")
        {
            var urlTemplate = "TXN/Performances/?performanceIds={0}&seasonId={1}&productionSeasonId={2}";
            urlTemplate = string.Format(urlTemplate, performanceIds,seasonId,productionSeasonId);
            return await restClient.AtUrl(urlTemplate).Get<Performances>();
        }

        /// <summary>
        /// Get Summary performance information
        /// For single production season, a comma separated list of performance ids and/or single seasonId.
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <param name="seasonId"></param>
        /// <param name="productionSeasonId"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformanceSummaries>> GetSummaries(string performanceIds = "", string seasonId = "", string productionSeasonId = "")
        {
            var urlTemplate = "TXN/Performances/Summary/?performanceIds={0}&seasonId={1}&productionSeasonId={2}";
            urlTemplate = string.Format(urlTemplate, performanceIds,seasonId,productionSeasonId);
            return await restClient.AtUrl(urlTemplate).Get<PerformanceSummaries>();
        }

        /// <summary>
        /// Get details of a performance.
        /// </summary>
        /// <param name="performanceId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Performance>> Get(string performanceId = "")
        {
             var urlTemplate = "TXN/Performances/{0}";
             urlTemplate = string.Format(urlTemplate, performanceId);
            return await restClient.AtUrl(urlTemplate).Get<Performance>();
        }

        /// <summary>
        /// Get pricing details for a set of performances (performanceIds= comma separated list of performance Ids). Also pass asOfDateTime to get prices effective as of that date time. ModeOfSale and PriceType parameters can be used to filter the returned prices.
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <param name="asOfDateTime"></param>
        /// <param name="modeOfSaleId"></param>
        /// <param name="priceTypeId"></param>
        /// <param name="expandPerformancePriceType">When set to True, price details for each price layer on the performance are broken out</param>
        /// <param name="includeOnlyBasePrice">When set to True, only the price type marked as the base price for the performance is returned</param>
        /// <param name="sourceId">When a source code is passed, prices associated with offers tied to that source will be noted in the response with Offer=true</param>
        /// <returns></returns>
        public async Task<RestResponse<Prices>> GetPrices(string performanceIds = "", string asOfDateTime = "", string modeOfSaleId = "", string priceTypeId = "", string expandPerformancePriceType = "", string includeOnlyBasePrice = "", string sourceId = "")
        {
            var urlTemplate = "TXN/Performances/Prices/?performanceIds={0}&asOfDateTime={1}&modeOfSaleId={2}&priceTypeId={3}&expandPerformancePriceType={4}&includeOnlyBasePrice={5}&sourceId={6}";
            urlTemplate = string.Format(urlTemplate, performanceIds,asOfDateTime,modeOfSaleId,priceTypeId,expandPerformancePriceType,includeOnlyBasePrice,sourceId);
            return await restClient.AtUrl(urlTemplate).Get<Prices>();
        }

        /// <summary>
        /// Copy existing performance to a new performance with options.
        /// </summary>
        /// <param name="performanceCopyRequest"></param>
        public async Task<RestResponse<NoResponse>> Copy(PerformanceCopyRequest performanceCopyRequest)
        {
            return await restClient.AtUrl("TXN/Performances/Copy/").Post<PerformanceCopyRequest, NoResponse>(performanceCopyRequest);
        }

        /// <summary>
        /// Get performance zone availability for a set of performances.  If sectionIds are specified only zones with
        /// matching sections will be returned and the SectionSummaries node will be populated.
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <param name="sectionIds"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformanceZoneAvailabilities>> GetPerformanceZoneAvailabilities(string performanceIds, string sectionIds = "")
        {
            var urlTemplate = "TXN/Performances/Zones/?performanceIds={0}&sectionIds={1}";
            urlTemplate = string.Format(urlTemplate, performanceIds,sectionIds);
            return await restClient.AtUrl(urlTemplate).Get<PerformanceZoneAvailabilities>();
        }

        /// <summary>
        /// Get performance zone availability for a set of performances. If ConstituentId and MOS are provided, will also return availability based on allocations and constituent rank.
        /// </summary>
        /// <param name="performanceIds">A list of valid performance Ids</param>
        /// <param name="constituentId">The constituent to use to calculate allocation availability based on the constituent rank and MOS.  Required if modeOfSale is specified</param>
        /// <param name="modeOfSaleId">Required if constituentId is provided</param>
        /// <returns></returns>
        public async Task<RestResponse<PerformanceZoneAvailabilitiesWithConstituent>> GetPerformanceZoneAvailabilityWithConstituent(string performanceIds, string modeOfSaleId = "null", string constituentId = "null")
        {
            var urlTemplate = "TXN/Performances/ZoneAvailabilities/?performanceIds={0}&modeOfSaleId={1}&constituentId={2}";
            urlTemplate = string.Format(urlTemplate, performanceIds,modeOfSaleId,constituentId);
            return await restClient.AtUrl(urlTemplate).Get<PerformanceZoneAvailabilitiesWithConstituent>();
        }

        /// <summary>
        /// Update seat holds for a performance
        /// </summary>
        /// <param name="performanceId"></param>
        /// <param name="updateSeatHoldRequest"></param>
        /// <returns></returns>
        public async Task<RestResponse<SeatHolds>> UpdateSeatHolds(string performanceId, UpdateSeatHoldRequest updateSeatHoldRequest)
        {
             var urlTemplate = "TXN/Performances/{0}/Seats/Holds/";
             urlTemplate = string.Format(urlTemplate, performanceId);
            return await restClient.AtUrl(urlTemplate).Post<UpdateSeatHoldRequest, SeatHolds>(updateSeatHoldRequest);
        }

        /// <summary>
        /// Expires seat holds for a performance and hold code
        /// </summary>
        /// <param name="performanceId"></param>
        /// <param name="holdCodeId"></param>
        /// <param name="expireSeatHoldRequest"></param>
        /// <returns></returns>
        public async Task<RestResponse<SeatHolds>> ExpireSeatHolds(string performanceId, string holdCodeId, ExpireSeatHoldRequest expireSeatHoldRequest)
        {
             var urlTemplate = "TXN/Performances/{0}/Seats/Holds/{1}/Expire";
             urlTemplate = string.Format(urlTemplate, performanceId, holdCodeId);
            return await restClient.AtUrl(urlTemplate).Put<ExpireSeatHoldRequest, SeatHolds>(expireSeatHoldRequest);
        }

        /// 
        public async Task<RestResponse<SeatHoldDetails>> GetSeatHoldDetails(string performanceId, string seatIds = "null", string holdCodeIds = "null", Boolean? includeAllHolds = null)
        {
             var urlTemplate = "TXN/Performances/{0}/Seats/Holds?seatIds={1}&holdCodeIds={2}&includeAllHolds={3}";
             urlTemplate = string.Format(urlTemplate, performanceId, seatIds, holdCodeIds, includeAllHolds);
            return await restClient.AtUrl(urlTemplate).Get<SeatHoldDetails>();
        }

        /// <summary>
        /// Returns details of all screens and the HouseMap for the facility used by a performance.  The screen details include which other screens are assigned to each screen navigation arrow button.
        /// </summary>
        /// <param name="performanceId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ScreenMap>> GetScreens(string performanceId)
        {
             var urlTemplate = "TXN/Performances/{0}/Screens";
             urlTemplate = string.Format(urlTemplate, performanceId);
            return await restClient.AtUrl(urlTemplate).Get<ScreenMap>();
        }

        /// <summary>
        /// Returns details for seats in a performance
        /// The seats returned can be filtered by screen, section, or price zone. Allocation is returned based on MOS and constituent.
        /// Available seats can be filtered by price type availability, causing any seats that are not available for the specified price types to be listed with a status of 5, Not In Allocation.
        /// </summary>
        /// <param name="performanceId">ID of the performance</param>
        /// <param name="modeOfSaleId">Required parameter. Must be a valid MOS id</param>
        /// <param name="constituentId">Required parameter. Must be a valid constituent ID</param>
        /// <param name="zoneIds">zoneIds must be a comma seperated list of valid zone ids</param>
        /// <param name="sectionIds">sectionIds must be a comma seperated list of valid section ids</param>
        /// <param name="screenIds">screenIds must be a comma seperated list of valid screen ids for the specified performance</param>
        /// <param name="checkPriceTypeIds">checkPriceTypeIds must be either a list of valid price types or the token “All” </param>
        /// <param name="returnNonSeats">returnNonSeats indicates if locations on the seat map that are not seats should be included</param>
        /// <returns></returns>
        public async Task<RestResponse<Seats>> GetSeats(string performanceId, string modeOfSaleId = "null", string constituentId = "null", string zoneIds = "null", string sectionIds = "null", string screenIds = "null", string checkPriceTypeIds = "null", string returnNonSeats = "null")
        {
             var urlTemplate = "TXN/Performances/{0}/Seats?modeOfSaleId={1}&constituentId={2}&zoneIds={3}&sectionIds={4}&screenIds={5}&checkPriceTypeIds={6}&returnNonSeats={7}";
             urlTemplate = string.Format(urlTemplate, performanceId, modeOfSaleId, constituentId, zoneIds, sectionIds, screenIds, checkPriceTypeIds, returnNonSeats);
            return await restClient.AtUrl(urlTemplate).Get<Seats>();
        }

        /// <summary>
        /// Returns summary for seats in a performance
        /// Seat availability is summaried by screen, section and zone.
        /// The seats returned can be filtered by screen, section, or price zone. Allocation is returned based on MOS and constituent.
        /// Available seats can be filtered by price type availability, causing any seats that are not available for the specified price types to be listed with a status of 5, Not In Allocation.
        /// </summary>
        /// <param name="performanceId">ID of the performance</param>
        /// <param name="modeOfSaleId">Required parameter. Must be a valid MOS id</param>
        /// <param name="constituentId">Required parameter. Must be a valid constituent ID</param>
        /// <param name="zoneIds">zoneIds must be a comma seperated list of valid zone ids</param>
        /// <param name="sectionIds">sectionIds must be a comma seperated list of valid section ids</param>
        /// <param name="screenIds">screenIds must be a comma seperated list of valid screen ids for the specified performance</param>
        /// <param name="checkPriceTypeIds">checkPriceTypeIds must be either a list of valid price types or the token “All” </param>
        /// <param name="returnNonSeats">returnNonSeats indicates if locations on the seat map that are not seats should be included</param>
        /// <returns></returns>
        public async Task<RestResponse<SeatSummaries>> GetSeatSummaries(string performanceId, string modeOfSaleId = "null", string constituentId = "null", string zoneIds = "null", string sectionIds = "null", string screenIds = "null", string checkPriceTypeIds = "null", string returnNonSeats = "null")
        {
             var urlTemplate = "TXN/Performances/{0}/Seats/Summary?modeOfSaleId={1}&constituentId={2}&zoneIds={3}&sectionIds={4}&screenIds={5}&checkPriceTypeIds={6}&returnNonSeats={7}";
             urlTemplate = string.Format(urlTemplate, performanceId, modeOfSaleId, constituentId, zoneIds, sectionIds, screenIds, checkPriceTypeIds, returnNonSeats);
            return await restClient.AtUrl(urlTemplate).Get<SeatSummaries>();
        }

        /// <summary>
        /// Returns price, per seat fees, for each zone and price type for a the specified performance
        /// </summary>
        /// <param name="performanceId"></param>
        /// <param name="modeOfSaleId">Required, Must be a valid id from TR_MOS</param>
        /// <param name="priceTypeIds">A list of valid ids from TR_PRICE_TYPE. Filters the results</param>
        /// <param name="asOfDateTime">Date for pricing. Defaults to today</param>
        /// <returns></returns>
        public async Task<RestResponse<ProductSeatFees>> GetSeatFees(string performanceId, string modeOfSaleId, string priceTypeIds = "null", string asOfDateTime = "null")
        {
             var urlTemplate = "TXN/Performances/{0}/SeatFees?modeOfSaleId={1}&priceTypeIds={2}&asOfDateTime={3}";
             urlTemplate = string.Format(urlTemplate, performanceId, modeOfSaleId, priceTypeIds, asOfDateTime);
            return await restClient.AtUrl(urlTemplate).Get<ProductSeatFees>();
        }

        /// <summary>
        /// Search for performances, based on provided criteria.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<PerformanceSearchResponses>> Search(PerformanceSearchRequest request)
        {
            return await restClient.AtUrl("TXN/Performances/Search").Post<PerformanceSearchRequest, PerformanceSearchResponses>(request);
        }

    }
 

 
    /// 
    public class PerformancesFacadeBatch
    {
        private IRestClient restClient;

        public PerformancesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get performance detail information
        /// For single production season, a comma separated list of performance ids and/or single seasonId.
        /// </summary>
        /// <param name="performanceIds">One or more performance IDs</param>
        /// <param name="seasonId"></param>
        /// <param name="productionSeasonId"></param>
        /// <returns></returns>
        public Request GetAll(string performanceIds = "", string seasonId = "", string productionSeasonId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Performances";
            bRequest.Content = null;

            var urlTemplate = "TXN/Performances/?performanceIds={0}&seasonId={1}&productionSeasonId={2}";
            urlTemplate = string.Format(urlTemplate, performanceIds,seasonId,productionSeasonId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get Summary performance information
        /// For single production season, a comma separated list of performance ids and/or single seasonId.
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <param name="seasonId"></param>
        /// <param name="productionSeasonId"></param>
        /// <returns></returns>
        public Request GetSummaries(string performanceIds = "", string seasonId = "", string productionSeasonId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformanceSummaries";
            bRequest.Content = null;

            var urlTemplate = "TXN/Performances/Summary/?performanceIds={0}&seasonId={1}&productionSeasonId={2}";
            urlTemplate = string.Format(urlTemplate, performanceIds,seasonId,productionSeasonId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a performance.
        /// </summary>
        /// <param name="performanceId"></param>
        /// <returns></returns>
        public Request Get(string performanceId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Performance";
            bRequest.Content = null;

            var urlTemplate = "TXN/Performances/{0}";
            urlTemplate = string.Format(urlTemplate, performanceId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get pricing details for a set of performances (performanceIds= comma separated list of performance Ids). Also pass asOfDateTime to get prices effective as of that date time. ModeOfSale and PriceType parameters can be used to filter the returned prices.
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <param name="asOfDateTime"></param>
        /// <param name="modeOfSaleId"></param>
        /// <param name="priceTypeId"></param>
        /// <param name="expandPerformancePriceType">When set to True, price details for each price layer on the performance are broken out</param>
        /// <param name="includeOnlyBasePrice">When set to True, only the price type marked as the base price for the performance is returned</param>
        /// <param name="sourceId">When a source code is passed, prices associated with offers tied to that source will be noted in the response with Offer=true</param>
        /// <returns></returns>
        public Request GetPrices(string performanceIds = "", string asOfDateTime = "", string modeOfSaleId = "", string priceTypeId = "", string expandPerformancePriceType = "", string includeOnlyBasePrice = "", string sourceId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Prices";
            bRequest.Content = null;

            var urlTemplate = "TXN/Performances/Prices/?performanceIds={0}&asOfDateTime={1}&modeOfSaleId={2}&priceTypeId={3}&expandPerformancePriceType={4}&includeOnlyBasePrice={5}&sourceId={6}";
            urlTemplate = string.Format(urlTemplate, performanceIds,asOfDateTime,modeOfSaleId,priceTypeId,expandPerformancePriceType,includeOnlyBasePrice,sourceId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Copy existing performance to a new performance with options.
        /// </summary>
        /// <param name="performanceCopyRequest"></param>
        public Request Copy(PerformanceCopyRequest performanceCopyRequest, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = performanceCopyRequest;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/Performances/Copy/";

            return bRequest;
        }

        /// <summary>
        /// Get performance zone availability for a set of performances.  If sectionIds are specified only zones with
        /// matching sections will be returned and the SectionSummaries node will be populated.
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <param name="sectionIds"></param>
        /// <returns></returns>
        public Request GetPerformanceZoneAvailabilities(string performanceIds, string sectionIds = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformanceZoneAvailabilities";
            bRequest.Content = null;

            var urlTemplate = "TXN/Performances/Zones/?performanceIds={0}&sectionIds={1}";
            urlTemplate = string.Format(urlTemplate, performanceIds,sectionIds);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get performance zone availability for a set of performances. If ConstituentId and MOS are provided, will also return availability based on allocations and constituent rank.
        /// </summary>
        /// <param name="performanceIds">A list of valid performance Ids</param>
        /// <param name="constituentId">The constituent to use to calculate allocation availability based on the constituent rank and MOS.  Required if modeOfSale is specified</param>
        /// <param name="modeOfSaleId">Required if constituentId is provided</param>
        /// <returns></returns>
        public Request GetPerformanceZoneAvailabilityWithConstituent(string performanceIds, string modeOfSaleId = "null", string constituentId = "null", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformanceZoneAvailabilitiesWithConstituent";
            bRequest.Content = null;

            var urlTemplate = "TXN/Performances/ZoneAvailabilities/?performanceIds={0}&modeOfSaleId={1}&constituentId={2}";
            urlTemplate = string.Format(urlTemplate, performanceIds,modeOfSaleId,constituentId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Update seat holds for a performance
        /// </summary>
        /// <param name="performanceId"></param>
        /// <param name="updateSeatHoldRequest"></param>
        /// <returns></returns>
        public Request UpdateSeatHolds(string performanceId, UpdateSeatHoldRequest updateSeatHoldRequest, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SeatHolds";
            bRequest.Content = updateSeatHoldRequest;

            var urlTemplate = "TXN/Performances/{0}/Seats/Holds/";
            urlTemplate = string.Format(urlTemplate, performanceId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Expires seat holds for a performance and hold code
        /// </summary>
        /// <param name="performanceId"></param>
        /// <param name="holdCodeId"></param>
        /// <param name="expireSeatHoldRequest"></param>
        /// <returns></returns>
        public Request ExpireSeatHolds(string performanceId, string holdCodeId, ExpireSeatHoldRequest expireSeatHoldRequest, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SeatHolds";
            bRequest.Content = expireSeatHoldRequest;

            var urlTemplate = "TXN/Performances/{0}/Seats/Holds/{1}/Expire";
            urlTemplate = string.Format(urlTemplate, performanceId, holdCodeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetSeatHoldDetails(string performanceId, string seatIds = "null", string holdCodeIds = "null", Boolean? includeAllHolds = null, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SeatHoldDetails";
            bRequest.Content = null;

            var urlTemplate = "TXN/Performances/{0}/Seats/Holds?seatIds={1}&holdCodeIds={2}&includeAllHolds={3}";
            urlTemplate = string.Format(urlTemplate, performanceId, seatIds, holdCodeIds, includeAllHolds);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Returns details of all screens and the HouseMap for the facility used by a performance.  The screen details include which other screens are assigned to each screen navigation arrow button.
        /// </summary>
        /// <param name="performanceId"></param>
        /// <returns></returns>
        public Request GetScreens(string performanceId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ScreenMap";
            bRequest.Content = null;

            var urlTemplate = "TXN/Performances/{0}/Screens";
            urlTemplate = string.Format(urlTemplate, performanceId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Returns details for seats in a performance
        /// The seats returned can be filtered by screen, section, or price zone. Allocation is returned based on MOS and constituent.
        /// Available seats can be filtered by price type availability, causing any seats that are not available for the specified price types to be listed with a status of 5, Not In Allocation.
        /// </summary>
        /// <param name="performanceId">ID of the performance</param>
        /// <param name="modeOfSaleId">Required parameter. Must be a valid MOS id</param>
        /// <param name="constituentId">Required parameter. Must be a valid constituent ID</param>
        /// <param name="zoneIds">zoneIds must be a comma seperated list of valid zone ids</param>
        /// <param name="sectionIds">sectionIds must be a comma seperated list of valid section ids</param>
        /// <param name="screenIds">screenIds must be a comma seperated list of valid screen ids for the specified performance</param>
        /// <param name="checkPriceTypeIds">checkPriceTypeIds must be either a list of valid price types or the token “All” </param>
        /// <param name="returnNonSeats">returnNonSeats indicates if locations on the seat map that are not seats should be included</param>
        /// <returns></returns>
        public Request GetSeats(string performanceId, string modeOfSaleId = "null", string constituentId = "null", string zoneIds = "null", string sectionIds = "null", string screenIds = "null", string checkPriceTypeIds = "null", string returnNonSeats = "null", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Seats";
            bRequest.Content = null;

            var urlTemplate = "TXN/Performances/{0}/Seats?modeOfSaleId={1}&constituentId={2}&zoneIds={3}&sectionIds={4}&screenIds={5}&checkPriceTypeIds={6}&returnNonSeats={7}";
            urlTemplate = string.Format(urlTemplate, performanceId, modeOfSaleId, constituentId, zoneIds, sectionIds, screenIds, checkPriceTypeIds, returnNonSeats);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Returns summary for seats in a performance
        /// Seat availability is summaried by screen, section and zone.
        /// The seats returned can be filtered by screen, section, or price zone. Allocation is returned based on MOS and constituent.
        /// Available seats can be filtered by price type availability, causing any seats that are not available for the specified price types to be listed with a status of 5, Not In Allocation.
        /// </summary>
        /// <param name="performanceId">ID of the performance</param>
        /// <param name="modeOfSaleId">Required parameter. Must be a valid MOS id</param>
        /// <param name="constituentId">Required parameter. Must be a valid constituent ID</param>
        /// <param name="zoneIds">zoneIds must be a comma seperated list of valid zone ids</param>
        /// <param name="sectionIds">sectionIds must be a comma seperated list of valid section ids</param>
        /// <param name="screenIds">screenIds must be a comma seperated list of valid screen ids for the specified performance</param>
        /// <param name="checkPriceTypeIds">checkPriceTypeIds must be either a list of valid price types or the token “All” </param>
        /// <param name="returnNonSeats">returnNonSeats indicates if locations on the seat map that are not seats should be included</param>
        /// <returns></returns>
        public Request GetSeatSummaries(string performanceId, string modeOfSaleId = "null", string constituentId = "null", string zoneIds = "null", string sectionIds = "null", string screenIds = "null", string checkPriceTypeIds = "null", string returnNonSeats = "null", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SeatSummaries";
            bRequest.Content = null;

            var urlTemplate = "TXN/Performances/{0}/Seats/Summary?modeOfSaleId={1}&constituentId={2}&zoneIds={3}&sectionIds={4}&screenIds={5}&checkPriceTypeIds={6}&returnNonSeats={7}";
            urlTemplate = string.Format(urlTemplate, performanceId, modeOfSaleId, constituentId, zoneIds, sectionIds, screenIds, checkPriceTypeIds, returnNonSeats);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Returns price, per seat fees, for each zone and price type for a the specified performance
        /// </summary>
        /// <param name="performanceId"></param>
        /// <param name="modeOfSaleId">Required, Must be a valid id from TR_MOS</param>
        /// <param name="priceTypeIds">A list of valid ids from TR_PRICE_TYPE. Filters the results</param>
        /// <param name="asOfDateTime">Date for pricing. Defaults to today</param>
        /// <returns></returns>
        public Request GetSeatFees(string performanceId, string modeOfSaleId, string priceTypeIds = "null", string asOfDateTime = "null", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ProductSeatFees";
            bRequest.Content = null;

            var urlTemplate = "TXN/Performances/{0}/SeatFees?modeOfSaleId={1}&priceTypeIds={2}&asOfDateTime={3}";
            urlTemplate = string.Format(urlTemplate, performanceId, modeOfSaleId, priceTypeIds, asOfDateTime);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Search for performances, based on provided criteria.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request Search(PerformanceSearchRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PerformanceSearchResponses";
            bRequest.Content = request;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/Performances/Search";

            return bRequest;
        }

    }
 

 
    /// 
    public class PledgeBillingFacade
    {
        private IRestClient restClient;

        public PledgeBillingFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// For a given campaign, funds, bill types etc., It raises bills for all those scheduled payments that have due date between given start and end dates. It also checks to see that a bill was not raised after a given 'cut off date'.
        /// </summary>
        /// <param name="pledgeBillingRequest"></param>
        /// <returns></returns>
        public async Task<RestResponse<PledgeBillingResponses>> BillPledges(PledgeBillingRequest pledgeBillingRequest)
        {
            return await restClient.AtUrl("TXN/PledgeBilling/").Post<PledgeBillingRequest, PledgeBillingResponses>(pledgeBillingRequest);
        }

    }
 

 
    /// 
    public class PledgeBillingFacadeBatch
    {
        private IRestClient restClient;

        public PledgeBillingFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// For a given campaign, funds, bill types etc., It raises bills for all those scheduled payments that have due date between given start and end dates. It also checks to see that a bill was not raised after a given 'cut off date'.
        /// </summary>
        /// <param name="pledgeBillingRequest"></param>
        /// <returns></returns>
        public Request BillPledges(PledgeBillingRequest pledgeBillingRequest, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PledgeBillingResponses";
            bRequest.Content = pledgeBillingRequest;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PledgeBilling/";

            return bRequest;
        }

    }
 

 
    /// 
    public class PriceEventsFacade
    {
        private IRestClient restClient;

        public PriceEventsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all price events for a performance, performance price type or performance price detail. From and To Date parameters can be used to filter the events. If both are specified, then events between those dates would be returned. If only fromDate is specified then all events with a startDate greater than that date would be returned. If only toDate is specified then all events with a startDate less than that date would be returned.
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <param name="performancePriceLayerIds"></param>
        /// <param name="performancePriceTypeIds"></param>
        /// <param name="performancePriceIds"></param>
        /// <param name="fromDate"></param>
        /// <param name="toDate"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceEvents>> GetAll(string performanceIds = "", string performancePriceLayerIds = "", string performancePriceTypeIds = "", string performancePriceIds = "", string fromDate = "", string toDate = "")
        {
            var urlTemplate = "TXN/PriceEvents/?performanceIds={0}&performancePriceLayerIds={1}&performancePriceTypeIds={2}&performancePriceIds={3}&fromDate={4}&toDate={5}";
            urlTemplate = string.Format(urlTemplate, performanceIds,performancePriceLayerIds,performancePriceTypeIds,performancePriceIds,fromDate,toDate);
            return await restClient.AtUrl(urlTemplate).Get<PriceEvents>();
        }

        /// <summary>
        /// Get details of a price event.
        /// </summary>
        /// <param name="priceEventId"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceEvent>> Get(string priceEventId = "")
        {
             var urlTemplate = "TXN/PriceEvents/{0}";
             urlTemplate = string.Format(urlTemplate, priceEventId);
            return await restClient.AtUrl(urlTemplate).Get<PriceEvent>();
        }

        /// <summary>
        /// Move a set of price events to a new date.
        /// </summary>
        /// <param name="request"></param>
        public async Task<RestResponse<NoResponse>> MoveTo(PriceEventMoveRequest request)
        {
            return await restClient.AtUrl("TXN/PriceEvents/MoveTo").Put<PriceEventMoveRequest, NoResponse>(request);
        }

        /// <summary>
        /// Gets a distinct set of dates that contain events for the given list of performances.
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceEventDates>> GetDates(string performanceIds = "")
        {
            var urlTemplate = "TXN/PriceEvents/Dates/?performanceIds={0}";
            urlTemplate = string.Format(urlTemplate, performanceIds);
            return await restClient.AtUrl(urlTemplate).Get<PriceEventDates>();
        }

        /// <summary>
        /// Delete an existing price event.
        /// </summary>
        /// <param name="priceEventId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string priceEventId)
        {
             var urlTemplate = "TXN/PriceEvents/{0}";
             urlTemplate = string.Format(urlTemplate, priceEventId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PriceEventsFacadeBatch
    {
        private IRestClient restClient;

        public PriceEventsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all price events for a performance, performance price type or performance price detail. From and To Date parameters can be used to filter the events. If both are specified, then events between those dates would be returned. If only fromDate is specified then all events with a startDate greater than that date would be returned. If only toDate is specified then all events with a startDate less than that date would be returned.
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <param name="performancePriceLayerIds"></param>
        /// <param name="performancePriceTypeIds"></param>
        /// <param name="performancePriceIds"></param>
        /// <param name="fromDate"></param>
        /// <param name="toDate"></param>
        /// <returns></returns>
        public Request GetAll(string performanceIds = "", string performancePriceLayerIds = "", string performancePriceTypeIds = "", string performancePriceIds = "", string fromDate = "", string toDate = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceEvents";
            bRequest.Content = null;

            var urlTemplate = "TXN/PriceEvents/?performanceIds={0}&performancePriceLayerIds={1}&performancePriceTypeIds={2}&performancePriceIds={3}&fromDate={4}&toDate={5}";
            urlTemplate = string.Format(urlTemplate, performanceIds,performancePriceLayerIds,performancePriceTypeIds,performancePriceIds,fromDate,toDate);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a price event.
        /// </summary>
        /// <param name="priceEventId"></param>
        /// <returns></returns>
        public Request Get(string priceEventId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceEvent";
            bRequest.Content = null;

            var urlTemplate = "TXN/PriceEvents/{0}";
            urlTemplate = string.Format(urlTemplate, priceEventId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Move a set of price events to a new date.
        /// </summary>
        /// <param name="request"></param>
        public Request MoveTo(PriceEventMoveRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = request;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PriceEvents/MoveTo";

            return bRequest;
        }

        /// <summary>
        /// Gets a distinct set of dates that contain events for the given list of performances.
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <returns></returns>
        public Request GetDates(string performanceIds = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceEventDates";
            bRequest.Content = null;

            var urlTemplate = "TXN/PriceEvents/Dates/?performanceIds={0}";
            urlTemplate = string.Format(urlTemplate, performanceIds);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing price event.
        /// </summary>
        /// <param name="priceEventId"></param>
        public Request Delete(string priceEventId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/PriceEvents/{0}";
            urlTemplate = string.Format(urlTemplate, priceEventId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PriceTemplatesFacade
    {
        private IRestClient restClient;

        public PriceTemplatesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all price templates. Optionally filtered by zoneMap and/or facility.
        /// </summary>
        /// <param name="zoneMapId"></param>
        /// <param name="facilityId"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceTemplates>> GetAll(string zoneMapId = "", string facilityId = "")
        {
            var urlTemplate = "TXN/PriceTemplates/?zoneMapId={0}&facilityId={1}";
            urlTemplate = string.Format(urlTemplate, zoneMapId,facilityId);
            return await restClient.AtUrl(urlTemplate).Get<PriceTemplates>();
        }

        /// <summary>
        /// Get summary of all price templates. Optionally filtered by zoneMap and/or facility.
        /// </summary>
        /// <param name="zoneMapId"></param>
        /// <param name="facilityId"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceTemplateSummaries>> GetAllSummaries(string zoneMapId = "", string facilityId = "")
        {
            var urlTemplate = "TXN/PriceTemplates/Summary?zoneMapId={0}&facilityId={1}";
            urlTemplate = string.Format(urlTemplate, zoneMapId,facilityId);
            return await restClient.AtUrl(urlTemplate).Get<PriceTemplateSummaries>();
        }

        /// <summary>
        /// Get details of a price template.
        /// </summary>
        /// <param name="priceTemplateId"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceTemplate>> Get(string priceTemplateId = "")
        {
             var urlTemplate = "TXN/PriceTemplates/{0}";
             urlTemplate = string.Format(urlTemplate, priceTemplateId);
            return await restClient.AtUrl(urlTemplate).Get<PriceTemplate>();
        }

        /// <summary>
        /// Create a new price template.
        /// </summary>
        /// <param name="priceTemplate"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceTemplate>> Create(PriceTemplate priceTemplate)
        {
            return await restClient.AtUrl("TXN/PriceTemplates/").Post<PriceTemplate, PriceTemplate>(priceTemplate);
        }

        /// <summary>
        /// Update an existing price template.
        /// </summary>
        /// <param name="priceTemplateId"></param>
        /// <param name="priceTemplate"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceTemplate>> Update(string priceTemplateId, PriceTemplate priceTemplate)
        {
             var urlTemplate = "TXN/PriceTemplates/{0}";
             urlTemplate = string.Format(urlTemplate, priceTemplateId);
            return await restClient.AtUrl(urlTemplate).Put<PriceTemplate, PriceTemplate>(priceTemplate);
        }

        /// <summary>
        /// Delete an existing price template.
        /// </summary>
        /// <param name="priceTemplateId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string priceTemplateId)
        {
             var urlTemplate = "TXN/PriceTemplates/{0}";
             urlTemplate = string.Format(urlTemplate, priceTemplateId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PriceTemplatesFacadeBatch
    {
        private IRestClient restClient;

        public PriceTemplatesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all price templates. Optionally filtered by zoneMap and/or facility.
        /// </summary>
        /// <param name="zoneMapId"></param>
        /// <param name="facilityId"></param>
        /// <returns></returns>
        public Request GetAll(string zoneMapId = "", string facilityId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTemplates";
            bRequest.Content = null;

            var urlTemplate = "TXN/PriceTemplates/?zoneMapId={0}&facilityId={1}";
            urlTemplate = string.Format(urlTemplate, zoneMapId,facilityId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get summary of all price templates. Optionally filtered by zoneMap and/or facility.
        /// </summary>
        /// <param name="zoneMapId"></param>
        /// <param name="facilityId"></param>
        /// <returns></returns>
        public Request GetAllSummaries(string zoneMapId = "", string facilityId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTemplateSummaries";
            bRequest.Content = null;

            var urlTemplate = "TXN/PriceTemplates/Summary?zoneMapId={0}&facilityId={1}";
            urlTemplate = string.Format(urlTemplate, zoneMapId,facilityId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a price template.
        /// </summary>
        /// <param name="priceTemplateId"></param>
        /// <returns></returns>
        public Request Get(string priceTemplateId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTemplate";
            bRequest.Content = null;

            var urlTemplate = "TXN/PriceTemplates/{0}";
            urlTemplate = string.Format(urlTemplate, priceTemplateId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new price template.
        /// </summary>
        /// <param name="priceTemplate"></param>
        /// <returns></returns>
        public Request Create(PriceTemplate priceTemplate, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTemplate";
            bRequest.Content = priceTemplate;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PriceTemplates/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing price template.
        /// </summary>
        /// <param name="priceTemplateId"></param>
        /// <param name="priceTemplate"></param>
        /// <returns></returns>
        public Request Update(string priceTemplateId, PriceTemplate priceTemplate, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTemplate";
            bRequest.Content = priceTemplate;

            var urlTemplate = "TXN/PriceTemplates/{0}";
            urlTemplate = string.Format(urlTemplate, priceTemplateId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing price template.
        /// </summary>
        /// <param name="priceTemplateId"></param>
        public Request Delete(string priceTemplateId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/PriceTemplates/{0}";
            urlTemplate = string.Format(urlTemplate, priceTemplateId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PriceTypesFacade
    {
        private IRestClient restClient;

        public PriceTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all price types.
        /// </summary>
        /// <returns></returns>
        public async Task<RestResponse<PriceTypes>> GetAll(string maintenanceMode = "false")
        {
            var urlTemplate = "TXN/PriceTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PriceTypes>();
        }

        /// <summary>
        /// Get summary of all price types.
        /// </summary>
        /// <returns></returns>
        public async Task<RestResponse<PriceTypeSummaries>> GetSummaries(string maintenanceMode = "false")
        {
            var urlTemplate = "TXN/PriceTypes/Summary/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);
            return await restClient.AtUrl(urlTemplate).Get<PriceTypeSummaries>();
        }

        /// <summary>
        /// Get all valid price types for a performance/package and a mode of sale. A comma separated list of performance ids can be specified for a flex package.
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <param name="packageId"></param>
        /// <param name="modeOfSaleId"></param>
        /// <param name="sourceId"></param>
        /// <param name="orderDateTime"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceTypeDetails>> GetValidPriceTypes(string performanceIds = "", string packageId = "", string modeOfSaleId = "", string sourceId = "", string orderDateTime = "")
        {
            var urlTemplate = "TXN/PriceTypes/Details/?performanceIds={0}&packageId={1}&modeOfSaleId={2}&sourceId={3}&orderDateTime={4}";
            urlTemplate = string.Format(urlTemplate, performanceIds,packageId,modeOfSaleId,sourceId,orderDateTime);
            return await restClient.AtUrl(urlTemplate).Get<PriceTypeDetails>();
        }

        /// <summary>
        /// Get valid zones for a set of performances or packages.
        /// </summary>
        /// <param name="performanceId"></param>
        /// <param name="packageId"></param>
        /// <param name="priceTypeId"></param>
        /// <param name="orderDateTime"></param>
        /// <returns></returns>
        public async Task<RestResponse<ZoneSummaries>> GetValidZones(string performanceId = "", string packageId = "", string priceTypeId = "", string orderDateTime = "")
        {
            var urlTemplate = "TXN/PriceTypes/Zones/?performanceId={0}&packageId={1}&priceTypeId={2}&orderDateTime={3}";
            urlTemplate = string.Format(urlTemplate, performanceId,packageId,priceTypeId,orderDateTime);
            return await restClient.AtUrl(urlTemplate).Get<ZoneSummaries>();
        }

        /// <summary>
        /// Gets valid price type reasons for the specified price type
        /// </summary>
        /// <param name="priceTypeId"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceTypeReasonMaps>> GetReasons(string priceTypeId = "")
        {
            var urlTemplate = "TXN/PriceTypes/Reasons/?priceTypeId={0}";
            urlTemplate = string.Format(urlTemplate, priceTypeId);
            return await restClient.AtUrl(urlTemplate).Get<PriceTypeReasonMaps>();
        }

        /// <summary>
        /// Get details of a price type.
        /// </summary>
        /// <param name="priceTypeId"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceType>> Get(string priceTypeId)
        {
             var urlTemplate = "TXN/PriceTypes/{0}";
             urlTemplate = string.Format(urlTemplate, priceTypeId);
            return await restClient.AtUrl(urlTemplate).Get<PriceType>();
        }

        /// <summary>
        /// Create a new price type.
        /// </summary>
        /// <param name="priceType"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceType>> Create(PriceType priceType)
        {
            return await restClient.AtUrl("TXN/PriceTypes/").Post<PriceType, PriceType>(priceType);
        }

        /// <summary>
        /// Update an existing price type.
        /// </summary>
        /// <param name="priceTypeId"></param>
        /// <param name="priceType"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceType>> Update(string priceTypeId, PriceType priceType)
        {
             var urlTemplate = "TXN/PriceTypes/{0}";
             urlTemplate = string.Format(urlTemplate, priceTypeId);
            return await restClient.AtUrl(urlTemplate).Put<PriceType, PriceType>(priceType);
        }

        /// <summary>
        /// Delete an existing price type.
        /// </summary>
        /// <param name="priceTypeId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string priceTypeId)
        {
             var urlTemplate = "TXN/PriceTypes/{0}";
             urlTemplate = string.Format(urlTemplate, priceTypeId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PriceTypesFacadeBatch
    {
        private IRestClient restClient;

        public PriceTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all price types.
        /// </summary>
        /// <returns></returns>
        public Request GetAll(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTypes";
            bRequest.Content = null;

            var urlTemplate = "TXN/PriceTypes/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get summary of all price types.
        /// </summary>
        /// <returns></returns>
        public Request GetSummaries(string maintenanceMode = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTypeSummaries";
            bRequest.Content = null;

            var urlTemplate = "TXN/PriceTypes/Summary/?maintenanceMode={0}";
            urlTemplate = string.Format(urlTemplate, maintenanceMode);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get all valid price types for a performance/package and a mode of sale. A comma separated list of performance ids can be specified for a flex package.
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <param name="packageId"></param>
        /// <param name="modeOfSaleId"></param>
        /// <param name="sourceId"></param>
        /// <param name="orderDateTime"></param>
        /// <returns></returns>
        public Request GetValidPriceTypes(string performanceIds = "", string packageId = "", string modeOfSaleId = "", string sourceId = "", string orderDateTime = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTypeDetails";
            bRequest.Content = null;

            var urlTemplate = "TXN/PriceTypes/Details/?performanceIds={0}&packageId={1}&modeOfSaleId={2}&sourceId={3}&orderDateTime={4}";
            urlTemplate = string.Format(urlTemplate, performanceIds,packageId,modeOfSaleId,sourceId,orderDateTime);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get valid zones for a set of performances or packages.
        /// </summary>
        /// <param name="performanceId"></param>
        /// <param name="packageId"></param>
        /// <param name="priceTypeId"></param>
        /// <param name="orderDateTime"></param>
        /// <returns></returns>
        public Request GetValidZones(string performanceId = "", string packageId = "", string priceTypeId = "", string orderDateTime = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ZoneSummaries";
            bRequest.Content = null;

            var urlTemplate = "TXN/PriceTypes/Zones/?performanceId={0}&packageId={1}&priceTypeId={2}&orderDateTime={3}";
            urlTemplate = string.Format(urlTemplate, performanceId,packageId,priceTypeId,orderDateTime);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Gets valid price type reasons for the specified price type
        /// </summary>
        /// <param name="priceTypeId"></param>
        /// <returns></returns>
        public Request GetReasons(string priceTypeId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTypeReasonMaps";
            bRequest.Content = null;

            var urlTemplate = "TXN/PriceTypes/Reasons/?priceTypeId={0}";
            urlTemplate = string.Format(urlTemplate, priceTypeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a price type.
        /// </summary>
        /// <param name="priceTypeId"></param>
        /// <returns></returns>
        public Request Get(string priceTypeId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceType";
            bRequest.Content = null;

            var urlTemplate = "TXN/PriceTypes/{0}";
            urlTemplate = string.Format(urlTemplate, priceTypeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new price type.
        /// </summary>
        /// <param name="priceType"></param>
        /// <returns></returns>
        public Request Create(PriceType priceType, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceType";
            bRequest.Content = priceType;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PriceTypes/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing price type.
        /// </summary>
        /// <param name="priceTypeId"></param>
        /// <param name="priceType"></param>
        /// <returns></returns>
        public Request Update(string priceTypeId, PriceType priceType, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceType";
            bRequest.Content = priceType;

            var urlTemplate = "TXN/PriceTypes/{0}";
            urlTemplate = string.Format(urlTemplate, priceTypeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing price type.
        /// </summary>
        /// <param name="priceTypeId"></param>
        public Request Delete(string priceTypeId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/PriceTypes/{0}";
            urlTemplate = string.Format(urlTemplate, priceTypeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PriceTypeUserGroupsFacade
    {
        private IRestClient restClient;

        public PriceTypeUserGroupsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all price type user groups.
        /// </summary>
        /// <param name="userGroup"></param>
        /// <param name="priceTypeId"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceTypeUserGroups>> GetAll(string userGroup = "", string priceTypeId = "")
        {
            var urlTemplate = "TXN/PriceTypeUserGroups/?userGroup={0}&priceTypeId={1}";
            urlTemplate = string.Format(urlTemplate, userGroup,priceTypeId);
            return await restClient.AtUrl(urlTemplate).Get<PriceTypeUserGroups>();
        }

        /// <summary>
        /// Get details of a price type user group.
        /// </summary>
        /// <param name="priceTypeUserGroupId"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceTypeUserGroup>> Get(string priceTypeUserGroupId = "")
        {
             var urlTemplate = "TXN/PriceTypeUserGroups/{0}";
             urlTemplate = string.Format(urlTemplate, priceTypeUserGroupId);
            return await restClient.AtUrl(urlTemplate).Get<PriceTypeUserGroup>();
        }

        /// <summary>
        /// Create a new price type user group.
        /// </summary>
        /// <param name="priceTypeUserGroup"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceTypeUserGroup>> Create(PriceTypeUserGroup priceTypeUserGroup)
        {
            return await restClient.AtUrl("TXN/PriceTypeUserGroups/").Post<PriceTypeUserGroup, PriceTypeUserGroup>(priceTypeUserGroup);
        }

        /// <summary>
        /// Update an existing price type user group.
        /// </summary>
        /// <param name="priceTypeUserGroupId"></param>
        /// <param name="priceTypeUserGroup"></param>
        /// <returns></returns>
        public async Task<RestResponse<PriceTypeUserGroup>> Update(string priceTypeUserGroupId, PriceTypeUserGroup priceTypeUserGroup)
        {
             var urlTemplate = "TXN/PriceTypeUserGroups/{0}";
             urlTemplate = string.Format(urlTemplate, priceTypeUserGroupId);
            return await restClient.AtUrl(urlTemplate).Put<PriceTypeUserGroup, PriceTypeUserGroup>(priceTypeUserGroup);
        }

        /// <summary>
        /// Delete an existing price type user group.
        /// </summary>
        /// <param name="priceTypeUserGroupId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string priceTypeUserGroupId)
        {
             var urlTemplate = "TXN/PriceTypeUserGroups/{0}";
             urlTemplate = string.Format(urlTemplate, priceTypeUserGroupId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PriceTypeUserGroupsFacadeBatch
    {
        private IRestClient restClient;

        public PriceTypeUserGroupsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all price type user groups.
        /// </summary>
        /// <param name="userGroup"></param>
        /// <param name="priceTypeId"></param>
        /// <returns></returns>
        public Request GetAll(string userGroup = "", string priceTypeId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTypeUserGroups";
            bRequest.Content = null;

            var urlTemplate = "TXN/PriceTypeUserGroups/?userGroup={0}&priceTypeId={1}";
            urlTemplate = string.Format(urlTemplate, userGroup,priceTypeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a price type user group.
        /// </summary>
        /// <param name="priceTypeUserGroupId"></param>
        /// <returns></returns>
        public Request Get(string priceTypeUserGroupId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTypeUserGroup";
            bRequest.Content = null;

            var urlTemplate = "TXN/PriceTypeUserGroups/{0}";
            urlTemplate = string.Format(urlTemplate, priceTypeUserGroupId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new price type user group.
        /// </summary>
        /// <param name="priceTypeUserGroup"></param>
        /// <returns></returns>
        public Request Create(PriceTypeUserGroup priceTypeUserGroup, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTypeUserGroup";
            bRequest.Content = priceTypeUserGroup;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PriceTypeUserGroups/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing price type user group.
        /// </summary>
        /// <param name="priceTypeUserGroupId"></param>
        /// <param name="priceTypeUserGroup"></param>
        /// <returns></returns>
        public Request Update(string priceTypeUserGroupId, PriceTypeUserGroup priceTypeUserGroup, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PriceTypeUserGroup";
            bRequest.Content = priceTypeUserGroup;

            var urlTemplate = "TXN/PriceTypeUserGroups/{0}";
            urlTemplate = string.Format(urlTemplate, priceTypeUserGroupId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing price type user group.
        /// </summary>
        /// <param name="priceTypeUserGroupId"></param>
        public Request Delete(string priceTypeUserGroupId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/PriceTypeUserGroups/{0}";
            urlTemplate = string.Format(urlTemplate, priceTypeUserGroupId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PricingRuleSetsFacade
    {
        private IRestClient restClient;

        public PricingRuleSetsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<PricingRuleSets>> GetAll()
        {
            return await restClient.AtUrl("TXN/PricingRuleSets/").Get<PricingRuleSets>();
        }

        /// 
        public async Task<RestResponse<PricingRuleSetSummaries>> GetAllSummaries()
        {
            return await restClient.AtUrl("TXN/PricingRuleSets/Summary/").Get<PricingRuleSetSummaries>();
        }

        /// <summary>
        /// Get details of a pricing rule set.
        /// </summary>
        /// <param name="pricingRuleSetId"></param>
        /// <returns></returns>
        public async Task<RestResponse<PricingRuleSet>> Get(string pricingRuleSetId = "")
        {
             var urlTemplate = "TXN/PricingRuleSets/{0}";
             urlTemplate = string.Format(urlTemplate, pricingRuleSetId);
            return await restClient.AtUrl(urlTemplate).Get<PricingRuleSet>();
        }

        /// <summary>
        /// Create a new pricing rule set.
        /// </summary>
        /// <param name="pricingRuleSet"></param>
        /// <returns></returns>
        public async Task<RestResponse<PricingRuleSet>> Create(PricingRuleSet pricingRuleSet)
        {
            return await restClient.AtUrl("TXN/PricingRuleSets/").Post<PricingRuleSet, PricingRuleSet>(pricingRuleSet);
        }

        /// <summary>
        /// Update an existing pricing rule set.
        /// </summary>
        /// <param name="pricingRuleSetId"></param>
        /// <param name="pricingRuleSet"></param>
        /// <returns></returns>
        public async Task<RestResponse<PricingRuleSet>> Update(string pricingRuleSetId, PricingRuleSet pricingRuleSet)
        {
             var urlTemplate = "TXN/PricingRuleSets/{0}";
             urlTemplate = string.Format(urlTemplate, pricingRuleSetId);
            return await restClient.AtUrl(urlTemplate).Put<PricingRuleSet, PricingRuleSet>(pricingRuleSet);
        }

        /// <summary>
        /// Delete an existing pricing rule set.
        /// </summary>
        /// <param name="pricingRuleSetId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string pricingRuleSetId)
        {
             var urlTemplate = "TXN/PricingRuleSets/{0}";
             urlTemplate = string.Format(urlTemplate, pricingRuleSetId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PricingRuleSetsFacadeBatch
    {
        private IRestClient restClient;

        public PricingRuleSetsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PricingRuleSets";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PricingRuleSets/";

            return bRequest;
        }

        /// 
        public Request GetAllSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PricingRuleSetSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PricingRuleSets/Summary/";

            return bRequest;
        }

        /// <summary>
        /// Get details of a pricing rule set.
        /// </summary>
        /// <param name="pricingRuleSetId"></param>
        /// <returns></returns>
        public Request Get(string pricingRuleSetId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PricingRuleSet";
            bRequest.Content = null;

            var urlTemplate = "TXN/PricingRuleSets/{0}";
            urlTemplate = string.Format(urlTemplate, pricingRuleSetId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new pricing rule set.
        /// </summary>
        /// <param name="pricingRuleSet"></param>
        /// <returns></returns>
        public Request Create(PricingRuleSet pricingRuleSet, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PricingRuleSet";
            bRequest.Content = pricingRuleSet;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PricingRuleSets/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing pricing rule set.
        /// </summary>
        /// <param name="pricingRuleSetId"></param>
        /// <param name="pricingRuleSet"></param>
        /// <returns></returns>
        public Request Update(string pricingRuleSetId, PricingRuleSet pricingRuleSet, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PricingRuleSet";
            bRequest.Content = pricingRuleSet;

            var urlTemplate = "TXN/PricingRuleSets/{0}";
            urlTemplate = string.Format(urlTemplate, pricingRuleSetId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing pricing rule set.
        /// </summary>
        /// <param name="pricingRuleSetId"></param>
        public Request Delete(string pricingRuleSetId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/PricingRuleSets/{0}";
            urlTemplate = string.Format(urlTemplate, pricingRuleSetId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class PricingRulesFacade
    {
        private IRestClient restClient;

        public PricingRulesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Gets all pricing rules or filtered set
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <param name="packageIds"></param>
        /// <param name="orderDate"></param>
        /// <param name="modeOfSaleId"></param>
        /// <returns></returns>
        public async Task<RestResponse<PricingRules>> GetAll(string performanceIds = "null", string packageIds = "null", string orderDate = "null", string modeOfSaleId = "null")
        {
            var urlTemplate = "TXN/PricingRules/?performanceIds={0}&packageIds={1}&orderDate={2}&modeOfSaleId={3}";
            urlTemplate = string.Format(urlTemplate, performanceIds,packageIds,orderDate,modeOfSaleId);
            return await restClient.AtUrl(urlTemplate).Get<PricingRules>();
        }

        /// 
        public async Task<RestResponse<PricingRuleSummaries>> GetAllSummary()
        {
            return await restClient.AtUrl("TXN/PricingRules/Summary").Get<PricingRuleSummaries>();
        }

        /// <summary>
        /// Get details of a pricing rule.
        /// </summary>
        /// <param name="pricingRuleId"></param>
        /// <returns></returns>
        public async Task<RestResponse<PricingRule>> Get(string pricingRuleId = "")
        {
             var urlTemplate = "TXN/PricingRules/{0}";
             urlTemplate = string.Format(urlTemplate, pricingRuleId);
            return await restClient.AtUrl(urlTemplate).Get<PricingRule>();
        }

        /// <summary>
        /// Create a new pricing rule.
        /// </summary>
        /// <param name="pricingRule"></param>
        /// <returns></returns>
        public async Task<RestResponse<PricingRule>> Create(PricingRule pricingRule)
        {
            return await restClient.AtUrl("TXN/PricingRules/").Post<PricingRule, PricingRule>(pricingRule);
        }

        /// <summary>
        /// Update an existing pricing rule.
        /// </summary>
        /// <param name="pricingRuleId"></param>
        /// <param name="pricingRule"></param>
        /// <returns></returns>
        public async Task<RestResponse<PricingRule>> Update(string pricingRuleId, PricingRule pricingRule)
        {
             var urlTemplate = "TXN/PricingRules/{0}";
             urlTemplate = string.Format(urlTemplate, pricingRuleId);
            return await restClient.AtUrl(urlTemplate).Put<PricingRule, PricingRule>(pricingRule);
        }

        /// <summary>
        /// Delete an existing pricing rule.
        /// </summary>
        /// <param name="pricingRuleId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string pricingRuleId)
        {
             var urlTemplate = "TXN/PricingRules/{0}";
             urlTemplate = string.Format(urlTemplate, pricingRuleId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class PricingRulesFacadeBatch
    {
        private IRestClient restClient;

        public PricingRulesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Gets all pricing rules or filtered set
        /// </summary>
        /// <param name="performanceIds"></param>
        /// <param name="packageIds"></param>
        /// <param name="orderDate"></param>
        /// <param name="modeOfSaleId"></param>
        /// <returns></returns>
        public Request GetAll(string performanceIds = "null", string packageIds = "null", string orderDate = "null", string modeOfSaleId = "null", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PricingRules";
            bRequest.Content = null;

            var urlTemplate = "TXN/PricingRules/?performanceIds={0}&packageIds={1}&orderDate={2}&modeOfSaleId={3}";
            urlTemplate = string.Format(urlTemplate, performanceIds,packageIds,orderDate,modeOfSaleId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// 
        public Request GetAllSummary(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PricingRuleSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PricingRules/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get details of a pricing rule.
        /// </summary>
        /// <param name="pricingRuleId"></param>
        /// <returns></returns>
        public Request Get(string pricingRuleId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PricingRule";
            bRequest.Content = null;

            var urlTemplate = "TXN/PricingRules/{0}";
            urlTemplate = string.Format(urlTemplate, pricingRuleId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new pricing rule.
        /// </summary>
        /// <param name="pricingRule"></param>
        /// <returns></returns>
        public Request Create(PricingRule pricingRule, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PricingRule";
            bRequest.Content = pricingRule;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/PricingRules/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing pricing rule.
        /// </summary>
        /// <param name="pricingRuleId"></param>
        /// <param name="pricingRule"></param>
        /// <returns></returns>
        public Request Update(string pricingRuleId, PricingRule pricingRule, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PricingRule";
            bRequest.Content = pricingRule;

            var urlTemplate = "TXN/PricingRules/{0}";
            urlTemplate = string.Format(urlTemplate, pricingRuleId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing pricing rule.
        /// </summary>
        /// <param name="pricingRuleId"></param>
        public Request Delete(string pricingRuleId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/PricingRules/{0}";
            urlTemplate = string.Format(urlTemplate, pricingRuleId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ProductionSeasonMembershipOrganizationsFacade
    {
        private IRestClient restClient;

        public ProductionSeasonMembershipOrganizationsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all production season membership organizations for a production season.
        /// </summary>
        /// <param name="productionSeasonId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ProductionSeasonMembershipOrganizations>> GetAll(string productionSeasonId = "")
        {
            var urlTemplate = "TXN/ProductionSeasonMembershipOrganizations/?productionSeasonId={0}";
            urlTemplate = string.Format(urlTemplate, productionSeasonId);
            return await restClient.AtUrl(urlTemplate).Get<ProductionSeasonMembershipOrganizations>();
        }

        /// <summary>
        /// Get a summary of all production season membership organizations for a production season.
        /// </summary>
        /// <param name="productionSeasonId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ProductionSeasonMembershipOrganizationSummaries>> GetAllSummaries(string productionSeasonId = "")
        {
            var urlTemplate = "TXN/ProductionSeasonMembershipOrganizations/Summary/?productionSeasonId={0}";
            urlTemplate = string.Format(urlTemplate, productionSeasonId);
            return await restClient.AtUrl(urlTemplate).Get<ProductionSeasonMembershipOrganizationSummaries>();
        }

        /// <summary>
        /// Get details of a specific production season membership organization.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ProductionSeasonMembershipOrganization>> Get(string id = "")
        {
             var urlTemplate = "TXN/ProductionSeasonMembershipOrganizations/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Get<ProductionSeasonMembershipOrganization>();
        }

        /// <summary>
        /// Create a new production season membership organization.
        /// </summary>
        /// <param name="productionSeasonMembershipOrganization"></param>
        /// <returns></returns>
        public async Task<RestResponse<ProductionSeasonMembershipOrganization>> Create(ProductionSeasonMembershipOrganization productionSeasonMembershipOrganization)
        {
            return await restClient.AtUrl("TXN/ProductionSeasonMembershipOrganizations/").Post<ProductionSeasonMembershipOrganization, ProductionSeasonMembershipOrganization>(productionSeasonMembershipOrganization);
        }

        /// <summary>
        /// Update an existing production season membership organization.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="productionSeasonMembershipOrganization"></param>
        /// <returns></returns>
        public async Task<RestResponse<ProductionSeasonMembershipOrganization>> Update(string id, ProductionSeasonMembershipOrganization productionSeasonMembershipOrganization)
        {
             var urlTemplate = "TXN/ProductionSeasonMembershipOrganizations/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<ProductionSeasonMembershipOrganization, ProductionSeasonMembershipOrganization>(productionSeasonMembershipOrganization);
        }

        /// <summary>
        /// Delete an existing production season membership organization.
        /// </summary>
        /// <param name="id"></param>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "TXN/ProductionSeasonMembershipOrganizations/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ProductionSeasonMembershipOrganizationsFacadeBatch
    {
        private IRestClient restClient;

        public ProductionSeasonMembershipOrganizationsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all production season membership organizations for a production season.
        /// </summary>
        /// <param name="productionSeasonId"></param>
        /// <returns></returns>
        public Request GetAll(string productionSeasonId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ProductionSeasonMembershipOrganizations";
            bRequest.Content = null;

            var urlTemplate = "TXN/ProductionSeasonMembershipOrganizations/?productionSeasonId={0}";
            urlTemplate = string.Format(urlTemplate, productionSeasonId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get a summary of all production season membership organizations for a production season.
        /// </summary>
        /// <param name="productionSeasonId"></param>
        /// <returns></returns>
        public Request GetAllSummaries(string productionSeasonId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ProductionSeasonMembershipOrganizationSummaries";
            bRequest.Content = null;

            var urlTemplate = "TXN/ProductionSeasonMembershipOrganizations/Summary/?productionSeasonId={0}";
            urlTemplate = string.Format(urlTemplate, productionSeasonId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a specific production season membership organization.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ProductionSeasonMembershipOrganization";
            bRequest.Content = null;

            var urlTemplate = "TXN/ProductionSeasonMembershipOrganizations/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new production season membership organization.
        /// </summary>
        /// <param name="productionSeasonMembershipOrganization"></param>
        /// <returns></returns>
        public Request Create(ProductionSeasonMembershipOrganization productionSeasonMembershipOrganization, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ProductionSeasonMembershipOrganization";
            bRequest.Content = productionSeasonMembershipOrganization;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/ProductionSeasonMembershipOrganizations/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing production season membership organization.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="productionSeasonMembershipOrganization"></param>
        /// <returns></returns>
        public Request Update(string id, ProductionSeasonMembershipOrganization productionSeasonMembershipOrganization, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ProductionSeasonMembershipOrganization";
            bRequest.Content = productionSeasonMembershipOrganization;

            var urlTemplate = "TXN/ProductionSeasonMembershipOrganizations/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing production season membership organization.
        /// </summary>
        /// <param name="id"></param>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/ProductionSeasonMembershipOrganizations/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ProductionSeasonsFacade
    {
        private IRestClient restClient;

        public ProductionSeasonsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get production season details.
        /// Returns the full details for multiple production seasons (based on a string of production IDs or season IDs), including description and short description, season, first and last performance date, and the four ticket text lines.
        /// </summary>
        /// <param name="seasonIds">One or more season IDs</param>
        /// <param name="productionIds">One or more production IDs</param>
        /// <param name="ids">One or more Production Season IDs</param>
        /// <returns></returns>
        public async Task<RestResponse<ProductionSeasons>> GetAll(string seasonIds = "", string productionIds = "", string ids = "")
        {
            var urlTemplate = "TXN/ProductionSeasons/?seasonIds={0}&productionIds={1}&ids={2}";
            urlTemplate = string.Format(urlTemplate, seasonIds,productionIds,ids);
            return await restClient.AtUrl(urlTemplate).Get<ProductionSeasons>();
        }

        /// <summary>
        /// Get production season summaries.
        /// Returns the production season summary (description, ID, and related production and season summaries) for all production seasons, all production seasons of a string of specific productions, or all production seasons in a string of specified seasons.
        /// </summary>
        /// <param name="seasonIds">One or more season IDs</param>
        /// <param name="productionIds">One or more production IDs</param>
        /// <param name="ids">One or more Production Season IDs</param>
        /// <returns></returns>
        public async Task<RestResponse<ProductionSeasonSummaries>> GetAllSummaries(string seasonIds = "", string productionIds = "", string ids = "")
        {
            var urlTemplate = "TXN/ProductionSeasons/Summary/?seasonIds={0}&productionIds={1}&ids={2}";
            urlTemplate = string.Format(urlTemplate, seasonIds,productionIds,ids);
            return await restClient.AtUrl(urlTemplate).Get<ProductionSeasonSummaries>();
        }

        /// <summary>
        /// Get details of a specific production season.
        /// Returns the full details for a single production season, including description and short description, season, first and last performance date, and the four ticket text lines.
        /// </summary>
        /// <param name="id">Production season ID</param>
        /// <returns></returns>
        public async Task<RestResponse<ProductionSeason>> Get(string id = "")
        {
             var urlTemplate = "TXN/ProductionSeasons/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Get<ProductionSeason>();
        }

        /// <summary>
        /// Search for production seasons
        /// Returns production seasons matching the specified search criteria.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<ProductionSeasonSearchResponses>> Search(ProductionSeasonSearchRequest request)
        {
            return await restClient.AtUrl("TXN/ProductionSeasons/Search").Post<ProductionSeasonSearchRequest, ProductionSeasonSearchResponses>(request);
        }

    }
 

 
    /// 
    public class ProductionSeasonsFacadeBatch
    {
        private IRestClient restClient;

        public ProductionSeasonsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get production season details.
        /// Returns the full details for multiple production seasons (based on a string of production IDs or season IDs), including description and short description, season, first and last performance date, and the four ticket text lines.
        /// </summary>
        /// <param name="seasonIds">One or more season IDs</param>
        /// <param name="productionIds">One or more production IDs</param>
        /// <param name="ids">One or more Production Season IDs</param>
        /// <returns></returns>
        public Request GetAll(string seasonIds = "", string productionIds = "", string ids = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ProductionSeasons";
            bRequest.Content = null;

            var urlTemplate = "TXN/ProductionSeasons/?seasonIds={0}&productionIds={1}&ids={2}";
            urlTemplate = string.Format(urlTemplate, seasonIds,productionIds,ids);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get production season summaries.
        /// Returns the production season summary (description, ID, and related production and season summaries) for all production seasons, all production seasons of a string of specific productions, or all production seasons in a string of specified seasons.
        /// </summary>
        /// <param name="seasonIds">One or more season IDs</param>
        /// <param name="productionIds">One or more production IDs</param>
        /// <param name="ids">One or more Production Season IDs</param>
        /// <returns></returns>
        public Request GetAllSummaries(string seasonIds = "", string productionIds = "", string ids = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ProductionSeasonSummaries";
            bRequest.Content = null;

            var urlTemplate = "TXN/ProductionSeasons/Summary/?seasonIds={0}&productionIds={1}&ids={2}";
            urlTemplate = string.Format(urlTemplate, seasonIds,productionIds,ids);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a specific production season.
        /// Returns the full details for a single production season, including description and short description, season, first and last performance date, and the four ticket text lines.
        /// </summary>
        /// <param name="id">Production season ID</param>
        /// <returns></returns>
        public Request Get(string id = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ProductionSeason";
            bRequest.Content = null;

            var urlTemplate = "TXN/ProductionSeasons/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Search for production seasons
        /// Returns production seasons matching the specified search criteria.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request Search(ProductionSeasonSearchRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ProductionSeasonSearchResponses";
            bRequest.Content = request;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/ProductionSeasons/Search";

            return bRequest;
        }

    }
 

 
    /// 
    public class ProductionsFacade
    {
        private IRestClient restClient;

        public ProductionsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all productions, Optionally filtered by one or more titles.
        /// </summary>
        /// <param name="titleIds"></param>
        /// <returns></returns>
        public async Task<RestResponse<Productions>> GetAll(string titleIds = "")
        {
            var urlTemplate = "TXN/Productions/?titleIds={0}";
            urlTemplate = string.Format(urlTemplate, titleIds);
            return await restClient.AtUrl(urlTemplate).Get<Productions>();
        }

        /// <summary>
        /// Get all production summaries, Optionally filtered by one or more titles.
        /// </summary>
        /// <param name="titleIds"></param>
        /// <returns></returns>
        public async Task<RestResponse<ProductionSummaries>> GetAllSummaries(string titleIds = "")
        {
            var urlTemplate = "TXN/Productions/Summary?titleIds={0}";
            urlTemplate = string.Format(urlTemplate, titleIds);
            return await restClient.AtUrl(urlTemplate).Get<ProductionSummaries>();
        }

        /// <summary>
        /// Get details of a specific production.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Production>> Get(string id = "")
        {
             var urlTemplate = "TXN/Productions/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Get<Production>();
        }

    }
 

 
    /// 
    public class ProductionsFacadeBatch
    {
        private IRestClient restClient;

        public ProductionsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all productions, Optionally filtered by one or more titles.
        /// </summary>
        /// <param name="titleIds"></param>
        /// <returns></returns>
        public Request GetAll(string titleIds = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Productions";
            bRequest.Content = null;

            var urlTemplate = "TXN/Productions/?titleIds={0}";
            urlTemplate = string.Format(urlTemplate, titleIds);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get all production summaries, Optionally filtered by one or more titles.
        /// </summary>
        /// <param name="titleIds"></param>
        /// <returns></returns>
        public Request GetAllSummaries(string titleIds = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ProductionSummaries";
            bRequest.Content = null;

            var urlTemplate = "TXN/Productions/Summary?titleIds={0}";
            urlTemplate = string.Format(urlTemplate, titleIds);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a specific production.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Production";
            bRequest.Content = null;

            var urlTemplate = "TXN/Productions/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ProductKeywordsFacade
    {
        private IRestClient restClient;

        public ProductKeywordsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Returns keywords for the requested production elements or packages.
        /// 
        /// For Production Elements: If the keyword is found, returns the keyword and the lowest level at which it was found in the production hierarchy (Title, Production, Production Season, Performance) for the requested element. Optionally, all matching keywords anywhere above the requested element in the production hierarchy can be returned with the ShowAll parameter.
        /// </summary>
        /// <param name="productionElementIds">Must be a list of valid perf, prod season, prod or title Ids (must be supplied if packageIds is not supplied)</param>
        /// <param name="packageIds">Must be a list of valid package ids (must be supplied if productionElementIds is not supplied)</param>
        /// <param name="keywordIds">Must be a comma delimited string of valid keyword ids.</param>
        /// <param name="showAll">Indicates if keywords from ‘parent’ requested element(s) is desired. This parameter is ignored for packages.</param>
        /// <returns></returns>
        public async Task<RestResponse<KeywordResults>> GetKeywords(string productionElementIds = "null", string packageIds = "null", string keywordIds = "null", string showAll = "false")
        {
            var urlTemplate = "TXN/ProductKeywords/?productionElementIds={0}&packageIds={1}&keywordIds={2}&showAll={3}";
            urlTemplate = string.Format(urlTemplate, productionElementIds,packageIds,keywordIds,showAll);
            return await restClient.AtUrl(urlTemplate).Get<KeywordResults>();
        }

    }
 

 
    /// 
    public class ProductKeywordsFacadeBatch
    {
        private IRestClient restClient;

        public ProductKeywordsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Returns keywords for the requested production elements or packages.
        /// 
        /// For Production Elements: If the keyword is found, returns the keyword and the lowest level at which it was found in the production hierarchy (Title, Production, Production Season, Performance) for the requested element. Optionally, all matching keywords anywhere above the requested element in the production hierarchy can be returned with the ShowAll parameter.
        /// </summary>
        /// <param name="productionElementIds">Must be a list of valid perf, prod season, prod or title Ids (must be supplied if packageIds is not supplied)</param>
        /// <param name="packageIds">Must be a list of valid package ids (must be supplied if productionElementIds is not supplied)</param>
        /// <param name="keywordIds">Must be a comma delimited string of valid keyword ids.</param>
        /// <param name="showAll">Indicates if keywords from ‘parent’ requested element(s) is desired. This parameter is ignored for packages.</param>
        /// <returns></returns>
        public Request GetKeywords(string productionElementIds = "null", string packageIds = "null", string keywordIds = "null", string showAll = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.KeywordResults";
            bRequest.Content = null;

            var urlTemplate = "TXN/ProductKeywords/?productionElementIds={0}&packageIds={1}&keywordIds={2}&showAll={3}";
            urlTemplate = string.Format(urlTemplate, productionElementIds,packageIds,keywordIds,showAll);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// <summary>
    /// A combined resource representing a performance or a package.
    /// </summary>
    public class ProductsFacade
    {
        private IRestClient restClient;

        public ProductsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Search for products based on a set of criteria.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<ProductSearchResponses>> Search(ProductSearchRequest request)
        {
            return await restClient.AtUrl("TXN/Products/Search").Post<ProductSearchRequest, ProductSearchResponses>(request);
        }

        /// <summary>
        /// Get product descriptions
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<ProductDescribeResponses>> Describe(ProductDescribeRequest request)
        {
            return await restClient.AtUrl("TXN/Products/Describe").Post<ProductDescribeRequest, ProductDescribeResponses>(request);
        }

    }
 

 
    /// <summary>
    /// A combined resource representing a performance or a package.
    /// </summary>
    public class ProductsFacadeBatch
    {
        private IRestClient restClient;

        public ProductsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Search for products based on a set of criteria.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request Search(ProductSearchRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ProductSearchResponses";
            bRequest.Content = request;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/Products/Search";

            return bRequest;
        }

        /// <summary>
        /// Get product descriptions
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request Describe(ProductDescribeRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ProductDescribeResponses";
            bRequest.Content = request;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/Products/Describe";

            return bRequest;
        }

    }
 

 
    /// 
    public class SalesLayoutsFacade
    {
        private IRestClient restClient;

        public SalesLayoutsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all sales layouts setup.
        /// </summary>
        /// <param name="primaryOnly"></param>
        /// <returns></returns>
        public async Task<RestResponse<SalesLayoutSummaries>> GetAllSummaries(string primaryOnly = "")
        {
            var urlTemplate = "TXN/SalesLayouts/Setup/Summary/?primaryOnly={0}";
            urlTemplate = string.Format(urlTemplate, primaryOnly);
            return await restClient.AtUrl(urlTemplate).Get<SalesLayoutSummaries>();
        }

        /// <summary>
        /// Get details of a sales layout setup.
        /// </summary>
        /// <param name="salesLayoutId"></param>
        /// <returns></returns>
        public async Task<RestResponse<SalesLayout>> Get(string salesLayoutId = "")
        {
             var urlTemplate = "TXN/SalesLayouts/Setup/{0}";
             urlTemplate = string.Format(urlTemplate, salesLayoutId);
            return await restClient.AtUrl(urlTemplate).Get<SalesLayout>();
        }

        /// <summary>
        /// Get details of a sales layout for use in orders.
        /// </summary>
        /// <param name="salesLayoutId"></param>
        /// <param name="modeOfSaleId"></param>
        /// <param name="orderDateTime"></param>
        /// <returns></returns>
        public async Task<RestResponse<SalesLayout>> GetForSale(string salesLayoutId = "", string modeOfSaleId = "", string orderDateTime = "")
        {
             var urlTemplate = "TXN/SalesLayouts/{0}?modeOfSaleId={1}&orderDateTime={2}";
             urlTemplate = string.Format(urlTemplate, salesLayoutId, modeOfSaleId, orderDateTime);
            return await restClient.AtUrl(urlTemplate).Get<SalesLayout>();
        }

        /// <summary>
        /// Create a new sales layout setup.
        /// </summary>
        /// <param name="salesLayout"></param>
        /// <returns></returns>
        public async Task<RestResponse<SalesLayout>> Create(SalesLayout salesLayout)
        {
            return await restClient.AtUrl("TXN/SalesLayouts/Setup/").Post<SalesLayout, SalesLayout>(salesLayout);
        }

        /// <summary>
        /// Update an existing sales layout setup.
        /// </summary>
        /// <param name="salesLayoutId"></param>
        /// <param name="salesLayout"></param>
        /// <returns></returns>
        public async Task<RestResponse<SalesLayout>> Update(string salesLayoutId, SalesLayout salesLayout)
        {
             var urlTemplate = "TXN/SalesLayouts/Setup/{0}";
             urlTemplate = string.Format(urlTemplate, salesLayoutId);
            return await restClient.AtUrl(urlTemplate).Put<SalesLayout, SalesLayout>(salesLayout);
        }

        /// <summary>
        /// Delete an existing sales layout setup.
        /// </summary>
        /// <param name="salesLayoutId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string salesLayoutId)
        {
             var urlTemplate = "TXN/SalesLayouts/Setup/{0}";
             urlTemplate = string.Format(urlTemplate, salesLayoutId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class SalesLayoutsFacadeBatch
    {
        private IRestClient restClient;

        public SalesLayoutsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all sales layouts setup.
        /// </summary>
        /// <param name="primaryOnly"></param>
        /// <returns></returns>
        public Request GetAllSummaries(string primaryOnly = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SalesLayoutSummaries";
            bRequest.Content = null;

            var urlTemplate = "TXN/SalesLayouts/Setup/Summary/?primaryOnly={0}";
            urlTemplate = string.Format(urlTemplate, primaryOnly);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a sales layout setup.
        /// </summary>
        /// <param name="salesLayoutId"></param>
        /// <returns></returns>
        public Request Get(string salesLayoutId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SalesLayout";
            bRequest.Content = null;

            var urlTemplate = "TXN/SalesLayouts/Setup/{0}";
            urlTemplate = string.Format(urlTemplate, salesLayoutId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a sales layout for use in orders.
        /// </summary>
        /// <param name="salesLayoutId"></param>
        /// <param name="modeOfSaleId"></param>
        /// <param name="orderDateTime"></param>
        /// <returns></returns>
        public Request GetForSale(string salesLayoutId = "", string modeOfSaleId = "", string orderDateTime = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SalesLayout";
            bRequest.Content = null;

            var urlTemplate = "TXN/SalesLayouts/{0}?modeOfSaleId={1}&orderDateTime={2}";
            urlTemplate = string.Format(urlTemplate, salesLayoutId, modeOfSaleId, orderDateTime);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new sales layout setup.
        /// </summary>
        /// <param name="salesLayout"></param>
        /// <returns></returns>
        public Request Create(SalesLayout salesLayout, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SalesLayout";
            bRequest.Content = salesLayout;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/SalesLayouts/Setup/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing sales layout setup.
        /// </summary>
        /// <param name="salesLayoutId"></param>
        /// <param name="salesLayout"></param>
        /// <returns></returns>
        public Request Update(string salesLayoutId, SalesLayout salesLayout, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SalesLayout";
            bRequest.Content = salesLayout;

            var urlTemplate = "TXN/SalesLayouts/Setup/{0}";
            urlTemplate = string.Format(urlTemplate, salesLayoutId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing sales layout setup.
        /// </summary>
        /// <param name="salesLayoutId"></param>
        public Request Delete(string salesLayoutId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/SalesLayouts/Setup/{0}";
            urlTemplate = string.Format(urlTemplate, salesLayoutId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class SubLineItemsFacade
    {
        private IRestClient restClient;

        public SubLineItemsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Returns sub line item summary data for a constituent
        /// </summary>
        /// <param name="constituentId">The constituent to return sub line items for. Required.</param>
        /// <param name="orderId">Optional paramter to limit the SLIs to a single order.</param>
        /// <param name="subLineItemStatusIds">Optional parameter to limit the status of the sub line items returned. Comma separated list of Ids from /ReferenceData/SubLineItemStatuses.</param>
        /// <param name="orderStartDate">Optional Start date of the order date range to search</param>
        /// <param name="orderEndDate">Optional End date of the order date range to search</param>
        /// <param name="performanceStartDate">Optional Start date of the performance date range to search</param>
        /// <param name="performanceEndDate">Optional End date of the performance date range to search.</param>
        /// <returns></returns>
        public async Task<RestResponse<SubLineItemSummaries>> GetSubLineItemSummaries(string constituentId, string orderId = "null", string subLineItemStatusIds = "null", string orderStartDate = "null", string orderEndDate = "null", string performanceStartDate = "null", string performanceEndDate = "null")
        {
            var urlTemplate = "TXN/SubLineItems/?constituentId={0}&orderId={1}&subLineItemStatusIds={2}&orderStartDate={3}&orderEndDate={4}&performanceStartDate={5}&performanceEndDate={6}";
            urlTemplate = string.Format(urlTemplate, constituentId,orderId,subLineItemStatusIds,orderStartDate,orderEndDate,performanceStartDate,performanceEndDate);
            return await restClient.AtUrl(urlTemplate).Get<SubLineItemSummaries>();
        }

    }
 

 
    /// 
    public class SubLineItemsFacadeBatch
    {
        private IRestClient restClient;

        public SubLineItemsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Returns sub line item summary data for a constituent
        /// </summary>
        /// <param name="constituentId">The constituent to return sub line items for. Required.</param>
        /// <param name="orderId">Optional paramter to limit the SLIs to a single order.</param>
        /// <param name="subLineItemStatusIds">Optional parameter to limit the status of the sub line items returned. Comma separated list of Ids from /ReferenceData/SubLineItemStatuses.</param>
        /// <param name="orderStartDate">Optional Start date of the order date range to search</param>
        /// <param name="orderEndDate">Optional End date of the order date range to search</param>
        /// <param name="performanceStartDate">Optional Start date of the performance date range to search</param>
        /// <param name="performanceEndDate">Optional End date of the performance date range to search.</param>
        /// <returns></returns>
        public Request GetSubLineItemSummaries(string constituentId, string orderId = "null", string subLineItemStatusIds = "null", string orderStartDate = "null", string orderEndDate = "null", string performanceStartDate = "null", string performanceEndDate = "null", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SubLineItemSummaries";
            bRequest.Content = null;

            var urlTemplate = "TXN/SubLineItems/?constituentId={0}&orderId={1}&subLineItemStatusIds={2}&orderStartDate={3}&orderEndDate={4}&performanceStartDate={5}&performanceEndDate={6}";
            urlTemplate = string.Format(urlTemplate, constituentId,orderId,subLineItemStatusIds,orderStartDate,orderEndDate,performanceStartDate,performanceEndDate);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class SurveyResponsesFacade
    {
        private IRestClient restClient;

        public SurveyResponsesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all survey responses.
        /// </summary>
        /// <param name="orderId"></param>
        /// <returns></returns>
        public async Task<RestResponse<SurveyResponses>> GetAll(string orderId = "")
        {
            var urlTemplate = "TXN/SurveyResponses/?orderId={0}";
            urlTemplate = string.Format(urlTemplate, orderId);
            return await restClient.AtUrl(urlTemplate).Get<SurveyResponses>();
        }

        /// <summary>
        /// Get details of a survey response.
        /// </summary>
        /// <param name="surveyResponseId"></param>
        /// <returns></returns>
        public async Task<RestResponse<SurveyResponse>> Get(string surveyResponseId = "")
        {
             var urlTemplate = "TXN/SurveyResponses/{0}";
             urlTemplate = string.Format(urlTemplate, surveyResponseId);
            return await restClient.AtUrl(urlTemplate).Get<SurveyResponse>();
        }

        /// <summary>
        /// Create a new survey response.
        /// </summary>
        /// <param name="surveyResponse"></param>
        /// <returns></returns>
        public async Task<RestResponse<SurveyResponse>> Create(SurveyResponse surveyResponse)
        {
            return await restClient.AtUrl("TXN/SurveyResponses/").Post<SurveyResponse, SurveyResponse>(surveyResponse);
        }

        /// <summary>
        /// Update an existing survey response.
        /// </summary>
        /// <param name="surveyResponseId"></param>
        /// <param name="surveyResponse"></param>
        /// <returns></returns>
        public async Task<RestResponse<SurveyResponse>> Update(string surveyResponseId, SurveyResponse surveyResponse)
        {
             var urlTemplate = "TXN/SurveyResponses/{0}";
             urlTemplate = string.Format(urlTemplate, surveyResponseId);
            return await restClient.AtUrl(urlTemplate).Put<SurveyResponse, SurveyResponse>(surveyResponse);
        }

        /// <summary>
        /// Delete an existing survey response.
        /// </summary>
        /// <param name="surveyResponseId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string surveyResponseId)
        {
             var urlTemplate = "TXN/SurveyResponses/{0}";
             urlTemplate = string.Format(urlTemplate, surveyResponseId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class SurveyResponsesFacadeBatch
    {
        private IRestClient restClient;

        public SurveyResponsesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all survey responses.
        /// </summary>
        /// <param name="orderId"></param>
        /// <returns></returns>
        public Request GetAll(string orderId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SurveyResponses";
            bRequest.Content = null;

            var urlTemplate = "TXN/SurveyResponses/?orderId={0}";
            urlTemplate = string.Format(urlTemplate, orderId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a survey response.
        /// </summary>
        /// <param name="surveyResponseId"></param>
        /// <returns></returns>
        public Request Get(string surveyResponseId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SurveyResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/SurveyResponses/{0}";
            urlTemplate = string.Format(urlTemplate, surveyResponseId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new survey response.
        /// </summary>
        /// <param name="surveyResponse"></param>
        /// <returns></returns>
        public Request Create(SurveyResponse surveyResponse, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SurveyResponse";
            bRequest.Content = surveyResponse;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/SurveyResponses/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing survey response.
        /// </summary>
        /// <param name="surveyResponseId"></param>
        /// <param name="surveyResponse"></param>
        /// <returns></returns>
        public Request Update(string surveyResponseId, SurveyResponse surveyResponse, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SurveyResponse";
            bRequest.Content = surveyResponse;

            var urlTemplate = "TXN/SurveyResponses/{0}";
            urlTemplate = string.Format(urlTemplate, surveyResponseId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing survey response.
        /// </summary>
        /// <param name="surveyResponseId"></param>
        public Request Delete(string surveyResponseId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/SurveyResponses/{0}";
            urlTemplate = string.Format(urlTemplate, surveyResponseId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class TemplatePricesFacade
    {
        private IRestClient restClient;

        public TemplatePricesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all template prices.
        /// </summary>
        /// <param name="templateId">Required.  Filter templatePrices to a single price template.</param>
        /// <returns></returns>
        public async Task<RestResponse<TemplatePrices>> GetAll(string templateId)
        {
            var urlTemplate = "TXN/TemplatePrices/?templateId={0}";
            urlTemplate = string.Format(urlTemplate, templateId);
            return await restClient.AtUrl(urlTemplate).Get<TemplatePrices>();
        }

        /// <summary>
        /// Get details of a template price.
        /// </summary>
        /// <param name="templatePriceId"></param>
        /// <returns></returns>
        public async Task<RestResponse<TemplatePrice>> Get(string templatePriceId = "")
        {
             var urlTemplate = "TXN/TemplatePrices/{0}";
             urlTemplate = string.Format(urlTemplate, templatePriceId);
            return await restClient.AtUrl(urlTemplate).Get<TemplatePrice>();
        }

        /// <summary>
        /// Create a new template price.
        /// </summary>
        /// <param name="templatePrice"></param>
        /// <returns></returns>
        public async Task<RestResponse<TemplatePrice>> Create(TemplatePrice templatePrice)
        {
            return await restClient.AtUrl("TXN/TemplatePrices/").Post<TemplatePrice, TemplatePrice>(templatePrice);
        }

        /// <summary>
        /// Create or update a set of template prices.
        /// </summary>
        /// <param name="templatePrices"></param>
        /// <returns></returns>
        public async Task<RestResponse<TemplatePrices>> BatchCreate(TemplatePrices templatePrices)
        {
            return await restClient.AtUrl("TXN/TemplatePrices/Batch/").Post<TemplatePrices, TemplatePrices>(templatePrices);
        }

        /// <summary>
        /// Update an existing template price.
        /// </summary>
        /// <param name="templatePriceId"></param>
        /// <param name="templatePrice"></param>
        /// <returns></returns>
        public async Task<RestResponse<TemplatePrice>> Update(string templatePriceId, TemplatePrice templatePrice)
        {
             var urlTemplate = "TXN/TemplatePrices/{0}";
             urlTemplate = string.Format(urlTemplate, templatePriceId);
            return await restClient.AtUrl(urlTemplate).Put<TemplatePrice, TemplatePrice>(templatePrice);
        }

    }
 

 
    /// 
    public class TemplatePricesFacadeBatch
    {
        private IRestClient restClient;

        public TemplatePricesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all template prices.
        /// </summary>
        /// <param name="templateId">Required.  Filter templatePrices to a single price template.</param>
        /// <returns></returns>
        public Request GetAll(string templateId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TemplatePrices";
            bRequest.Content = null;

            var urlTemplate = "TXN/TemplatePrices/?templateId={0}";
            urlTemplate = string.Format(urlTemplate, templateId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a template price.
        /// </summary>
        /// <param name="templatePriceId"></param>
        /// <returns></returns>
        public Request Get(string templatePriceId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TemplatePrice";
            bRequest.Content = null;

            var urlTemplate = "TXN/TemplatePrices/{0}";
            urlTemplate = string.Format(urlTemplate, templatePriceId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new template price.
        /// </summary>
        /// <param name="templatePrice"></param>
        /// <returns></returns>
        public Request Create(TemplatePrice templatePrice, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TemplatePrice";
            bRequest.Content = templatePrice;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/TemplatePrices/";

            return bRequest;
        }

        /// <summary>
        /// Create or update a set of template prices.
        /// </summary>
        /// <param name="templatePrices"></param>
        /// <returns></returns>
        public Request BatchCreate(TemplatePrices templatePrices, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TemplatePrices";
            bRequest.Content = templatePrices;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/TemplatePrices/Batch/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing template price.
        /// </summary>
        /// <param name="templatePriceId"></param>
        /// <param name="templatePrice"></param>
        /// <returns></returns>
        public Request Update(string templatePriceId, TemplatePrice templatePrice, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TemplatePrice";
            bRequest.Content = templatePrice;

            var urlTemplate = "TXN/TemplatePrices/{0}";
            urlTemplate = string.Format(urlTemplate, templatePriceId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class TemplatePriceTypesFacade
    {
        private IRestClient restClient;

        public TemplatePriceTypesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all template price type.
        /// </summary>
        /// <param name="templateId">Required.  Filter template price types to a specified price template.</param>
        /// <returns></returns>
        public async Task<RestResponse<TemplatePriceTypes>> GetAll(string templateId)
        {
            var urlTemplate = "TXN/TemplatePriceTypes/?templateId={0}";
            urlTemplate = string.Format(urlTemplate, templateId);
            return await restClient.AtUrl(urlTemplate).Get<TemplatePriceTypes>();
        }

        /// <summary>
        /// Get details of a template price type.
        /// </summary>
        /// <param name="templatePriceTypeId"></param>
        /// <returns></returns>
        public async Task<RestResponse<TemplatePriceType>> Get(string templatePriceTypeId = "")
        {
             var urlTemplate = "TXN/TemplatePriceTypes/{0}";
             urlTemplate = string.Format(urlTemplate, templatePriceTypeId);
            return await restClient.AtUrl(urlTemplate).Get<TemplatePriceType>();
        }

        /// <summary>
        /// Create a new template price type.
        /// </summary>
        /// <param name="templatePriceType"></param>
        /// <returns></returns>
        public async Task<RestResponse<TemplatePriceType>> Create(TemplatePriceType templatePriceType)
        {
            return await restClient.AtUrl("TXN/TemplatePriceTypes/").Post<TemplatePriceType, TemplatePriceType>(templatePriceType);
        }

        /// <summary>
        /// Create or update a set of template price types.
        /// </summary>
        /// <param name="templatePriceTypes"></param>
        /// <returns></returns>
        public async Task<RestResponse<TemplatePriceTypes>> BatchCreate(TemplatePriceTypes templatePriceTypes)
        {
            return await restClient.AtUrl("TXN/TemplatePriceTypes/Batch/").Post<TemplatePriceTypes, TemplatePriceTypes>(templatePriceTypes);
        }

        /// <summary>
        /// Update an existing template price type.
        /// </summary>
        /// <param name="templatePriceTypeId"></param>
        /// <param name="templatePriceType"></param>
        /// <returns></returns>
        public async Task<RestResponse<TemplatePriceType>> Update(string templatePriceTypeId, TemplatePriceType templatePriceType)
        {
             var urlTemplate = "TXN/TemplatePriceTypes/{0}";
             urlTemplate = string.Format(urlTemplate, templatePriceTypeId);
            return await restClient.AtUrl(urlTemplate).Put<TemplatePriceType, TemplatePriceType>(templatePriceType);
        }

        /// <summary>
        /// Delete an existing template price type.
        /// </summary>
        /// <param name="templatePriceTypeId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string templatePriceTypeId)
        {
             var urlTemplate = "TXN/TemplatePriceTypes/{0}";
             urlTemplate = string.Format(urlTemplate, templatePriceTypeId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class TemplatePriceTypesFacadeBatch
    {
        private IRestClient restClient;

        public TemplatePriceTypesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all template price type.
        /// </summary>
        /// <param name="templateId">Required.  Filter template price types to a specified price template.</param>
        /// <returns></returns>
        public Request GetAll(string templateId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TemplatePriceTypes";
            bRequest.Content = null;

            var urlTemplate = "TXN/TemplatePriceTypes/?templateId={0}";
            urlTemplate = string.Format(urlTemplate, templateId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a template price type.
        /// </summary>
        /// <param name="templatePriceTypeId"></param>
        /// <returns></returns>
        public Request Get(string templatePriceTypeId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TemplatePriceType";
            bRequest.Content = null;

            var urlTemplate = "TXN/TemplatePriceTypes/{0}";
            urlTemplate = string.Format(urlTemplate, templatePriceTypeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new template price type.
        /// </summary>
        /// <param name="templatePriceType"></param>
        /// <returns></returns>
        public Request Create(TemplatePriceType templatePriceType, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TemplatePriceType";
            bRequest.Content = templatePriceType;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/TemplatePriceTypes/";

            return bRequest;
        }

        /// <summary>
        /// Create or update a set of template price types.
        /// </summary>
        /// <param name="templatePriceTypes"></param>
        /// <returns></returns>
        public Request BatchCreate(TemplatePriceTypes templatePriceTypes, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TemplatePriceTypes";
            bRequest.Content = templatePriceTypes;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/TemplatePriceTypes/Batch/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing template price type.
        /// </summary>
        /// <param name="templatePriceTypeId"></param>
        /// <param name="templatePriceType"></param>
        /// <returns></returns>
        public Request Update(string templatePriceTypeId, TemplatePriceType templatePriceType, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TemplatePriceType";
            bRequest.Content = templatePriceType;

            var urlTemplate = "TXN/TemplatePriceTypes/{0}";
            urlTemplate = string.Format(urlTemplate, templatePriceTypeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing template price type.
        /// </summary>
        /// <param name="templatePriceTypeId"></param>
        public Request Delete(string templatePriceTypeId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/TemplatePriceTypes/{0}";
            urlTemplate = string.Format(urlTemplate, templatePriceTypeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class TitlesFacade
    {
        private IRestClient restClient;

        public TitlesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public async Task<RestResponse<Titles>> GetAll()
        {
            return await restClient.AtUrl("TXN/Titles/").Get<Titles>();
        }

        /// 
        public async Task<RestResponse<TitleSummaries>> GetAllSummaries()
        {
            return await restClient.AtUrl("TXN/Titles/Summary").Get<TitleSummaries>();
        }

        /// <summary>
        /// Get details of a specific title.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<Title>> Get(string id = "")
        {
             var urlTemplate = "TXN/Titles/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Get<Title>();
        }

    }
 

 
    /// 
    public class TitlesFacadeBatch
    {
        private IRestClient restClient;

        public TitlesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// 
        public Request GetAll(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Titles";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/Titles/";

            return bRequest;
        }

        /// 
        public Request GetAllSummaries(List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TitleSummaries";
            bRequest.Content = null;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/Titles/Summary";

            return bRequest;
        }

        /// <summary>
        /// Get details of a specific title.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Title";
            bRequest.Content = null;

            var urlTemplate = "TXN/Titles/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class WebContentsFacade
    {
        private IRestClient restClient;

        public WebContentsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Returns web content for the requested production elements or packages.
        /// The result can be filtered by content types.
        /// If the content type is found, returns the content value at the lowest level at which it was found in the production hierarchy (Title, Production, Production Season, Performance) for the requested element. Optionally, all matching content anywhere above the requested element in the production hierarchy can be returned with the ShowAll parameter.
        /// </summary>
        /// <param name="productionElementIds">A comma separated list of IDs of production elements. (must be supplied if packageIds is not supplied)</param>
        /// <param name="packageIds">A comma separated list of package IDs (must be supplied if productionElementIds is not supplied)</param>
        /// <param name="contentTypeIds">A comma separated list of content type IDs</param>
        /// <param name="showAll">Whether to return web content of the same content type from all levels of the production hierarchy</param>
        public async Task<RestResponse<WebContentResults>> GetWebContents(string productionElementIds = "null", string packageIds = "null", string contentTypeIds = "null", string showAll = "false")
        {
            var urlTemplate = "TXN/WebContents/?productionElementIds={0}&packageIds={1}&contentTypeIds={2}&showAll={3}";
            urlTemplate = string.Format(urlTemplate, productionElementIds,packageIds,contentTypeIds,showAll);
            return await restClient.AtUrl(urlTemplate).Get<WebContentResults>();
        }

    }
 

 
    /// 
    public class WebContentsFacadeBatch
    {
        private IRestClient restClient;

        public WebContentsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Returns web content for the requested production elements or packages.
        /// The result can be filtered by content types.
        /// If the content type is found, returns the content value at the lowest level at which it was found in the production hierarchy (Title, Production, Production Season, Performance) for the requested element. Optionally, all matching content anywhere above the requested element in the production hierarchy can be returned with the ShowAll parameter.
        /// </summary>
        /// <param name="productionElementIds">A comma separated list of IDs of production elements. (must be supplied if packageIds is not supplied)</param>
        /// <param name="packageIds">A comma separated list of package IDs (must be supplied if productionElementIds is not supplied)</param>
        /// <param name="contentTypeIds">A comma separated list of content type IDs</param>
        /// <param name="showAll">Whether to return web content of the same content type from all levels of the production hierarchy</param>
        public Request GetWebContents(string productionElementIds = "null", string packageIds = "null", string contentTypeIds = "null", string showAll = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WebContentResults";
            bRequest.Content = null;

            var urlTemplate = "TXN/WebContents/?productionElementIds={0}&packageIds={1}&contentTypeIds={2}&showAll={3}";
            urlTemplate = string.Format(urlTemplate, productionElementIds,packageIds,contentTypeIds,showAll);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ZoneMapsFacade
    {
        private IRestClient restClient;

        public ZoneMapsFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all zone maps, optionally filtered by facility and/or seat map.
        /// </summary>
        /// <param name="facilityId"></param>
        /// <param name="seatMapId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ZoneMaps>> GetAll(string facilityId = "", string seatMapId = "")
        {
            var urlTemplate = "TXN/ZoneMaps/?facilityId={0}&seatMapId={1}";
            urlTemplate = string.Format(urlTemplate, facilityId,seatMapId);
            return await restClient.AtUrl(urlTemplate).Get<ZoneMaps>();
        }

        /// <summary>
        /// Get a summary of all zone maps, optionally filtered by facility and/or seat map.
        /// </summary>
        /// <param name="facilityId"></param>
        /// <param name="seatMapId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ZoneMapSummaries>> GetSummaries(string facilityId = "", string seatMapId = "")
        {
            var urlTemplate = "TXN/ZoneMaps/Summary/?facilityId={0}&seatMapId={1}";
            urlTemplate = string.Format(urlTemplate, facilityId,seatMapId);
            return await restClient.AtUrl(urlTemplate).Get<ZoneMapSummaries>();
        }

        /// <summary>
        /// Get details of a specific zone map.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RestResponse<ZoneMap>> Get(string id = "")
        {
             var urlTemplate = "TXN/ZoneMaps/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Get<ZoneMap>();
        }

        /// <summary>
        /// Create a new zone map.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<ZoneMap>> Create(ZoneMap data)
        {
            return await restClient.AtUrl("TXN/ZoneMaps/").Post<ZoneMap, ZoneMap>(data);
        }

        /// <summary>
        /// Update an existing zone map.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="zoneMap"></param>
        /// <returns></returns>
        public async Task<RestResponse<ZoneMap>> Update(string id, ZoneMap zoneMap)
        {
             var urlTemplate = "TXN/ZoneMaps/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Put<ZoneMap, ZoneMap>(zoneMap);
        }

        /// <summary>
        /// Delete an existing zone map.
        /// </summary>
        /// <param name="id"></param>
        public async Task<RestResponse<NoResponse>> Delete(string id)
        {
             var urlTemplate = "TXN/ZoneMaps/{0}";
             urlTemplate = string.Format(urlTemplate, id);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

    }
 

 
    /// 
    public class ZoneMapsFacadeBatch
    {
        private IRestClient restClient;

        public ZoneMapsFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all zone maps, optionally filtered by facility and/or seat map.
        /// </summary>
        /// <param name="facilityId"></param>
        /// <param name="seatMapId"></param>
        /// <returns></returns>
        public Request GetAll(string facilityId = "", string seatMapId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ZoneMaps";
            bRequest.Content = null;

            var urlTemplate = "TXN/ZoneMaps/?facilityId={0}&seatMapId={1}";
            urlTemplate = string.Format(urlTemplate, facilityId,seatMapId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get a summary of all zone maps, optionally filtered by facility and/or seat map.
        /// </summary>
        /// <param name="facilityId"></param>
        /// <param name="seatMapId"></param>
        /// <returns></returns>
        public Request GetSummaries(string facilityId = "", string seatMapId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ZoneMapSummaries";
            bRequest.Content = null;

            var urlTemplate = "TXN/ZoneMaps/Summary/?facilityId={0}&seatMapId={1}";
            urlTemplate = string.Format(urlTemplate, facilityId,seatMapId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a specific zone map.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Request Get(string id = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ZoneMap";
            bRequest.Content = null;

            var urlTemplate = "TXN/ZoneMaps/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new zone map.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(ZoneMap data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ZoneMap";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/ZoneMaps/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing zone map.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="zoneMap"></param>
        /// <returns></returns>
        public Request Update(string id, ZoneMap zoneMap, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ZoneMap";
            bRequest.Content = zoneMap;

            var urlTemplate = "TXN/ZoneMaps/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing zone map.
        /// </summary>
        /// <param name="id"></param>
        public Request Delete(string id, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/ZoneMaps/{0}";
            urlTemplate = string.Format(urlTemplate, id);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class ZonesFacade
    {
        private IRestClient restClient;

        public ZonesFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all zones, optionally filtered by a set of zone maps.
        /// </summary>
        /// <param name="zoneMapIds"></param>
        /// <returns></returns>
        public async Task<RestResponse<Zones>> GetAll(string zoneMapIds = "")
        {
            var urlTemplate = "TXN/Zones/?zoneMapIds={0}";
            urlTemplate = string.Format(urlTemplate, zoneMapIds);
            return await restClient.AtUrl(urlTemplate).Get<Zones>();
        }

        /// <summary>
        /// Get a summary of all zones, optionally filtered by a set of zone maps.
        /// </summary>
        /// <param name="zoneMapIds"></param>
        /// <returns></returns>
        public async Task<RestResponse<ZoneSummaries>> GetSummaries(string zoneMapIds = "")
        {
            var urlTemplate = "TXN/Zones/Summary?zoneMapIds={0}";
            urlTemplate = string.Format(urlTemplate, zoneMapIds);
            return await restClient.AtUrl(urlTemplate).Get<ZoneSummaries>();
        }

        /// <summary>
        /// Get details of a specific zone.
        /// </summary>
        /// <param name="zoneMapId"></param>
        /// <param name="zoneId"></param>
        /// <returns></returns>
        public async Task<RestResponse<Zone>> Get(string zoneMapId = "", string zoneId = "")
        {
             var urlTemplate = "TXN/Zones/{0},{1}";
             urlTemplate = string.Format(urlTemplate, zoneMapId, zoneId);
            return await restClient.AtUrl(urlTemplate).Get<Zone>();
        }

        /// <summary>
        /// Create a new zone.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public async Task<RestResponse<Zone>> Create(Zone data)
        {
            return await restClient.AtUrl("TXN/Zones/").Post<Zone, Zone>(data);
        }

        /// <summary>
        /// Update an existing zone.
        /// </summary>
        /// <param name="zoneMapId"></param>
        /// <param name="zoneId"></param>
        /// <param name="zone"></param>
        /// <returns></returns>
        public async Task<RestResponse<Zone>> Update(string zoneMapId, string zoneId, Zone zone)
        {
             var urlTemplate = "TXN/Zones/{0},{1}";
             urlTemplate = string.Format(urlTemplate, zoneMapId, zoneId);
            return await restClient.AtUrl(urlTemplate).Put<Zone, Zone>(zone);
        }

        /// <summary>
        /// Delete an existing zone.
        /// </summary>
        /// <param name="zoneMapId"></param>
        /// <param name="zoneId"></param>
        public async Task<RestResponse<NoResponse>> Delete(string zoneMapId, string zoneId)
        {
             var urlTemplate = "TXN/Zones/{0},{1}";
             urlTemplate = string.Format(urlTemplate, zoneMapId, zoneId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Search for products based on a set of criteria.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<ZoneSearchResponses>> Search(ZoneSearchRequest request)
        {
            return await restClient.AtUrl("TXN/Zones/Search").Post<ZoneSearchRequest, ZoneSearchResponses>(request);
        }

    }
 

 
    /// 
    public class ZonesFacadeBatch
    {
        private IRestClient restClient;

        public ZonesFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Get all zones, optionally filtered by a set of zone maps.
        /// </summary>
        /// <param name="zoneMapIds"></param>
        /// <returns></returns>
        public Request GetAll(string zoneMapIds = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Zones";
            bRequest.Content = null;

            var urlTemplate = "TXN/Zones/?zoneMapIds={0}";
            urlTemplate = string.Format(urlTemplate, zoneMapIds);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get a summary of all zones, optionally filtered by a set of zone maps.
        /// </summary>
        /// <param name="zoneMapIds"></param>
        /// <returns></returns>
        public Request GetSummaries(string zoneMapIds = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ZoneSummaries";
            bRequest.Content = null;

            var urlTemplate = "TXN/Zones/Summary?zoneMapIds={0}";
            urlTemplate = string.Format(urlTemplate, zoneMapIds);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Get details of a specific zone.
        /// </summary>
        /// <param name="zoneMapId"></param>
        /// <param name="zoneId"></param>
        /// <returns></returns>
        public Request Get(string zoneMapId = "", string zoneId = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Zone";
            bRequest.Content = null;

            var urlTemplate = "TXN/Zones/{0},{1}";
            urlTemplate = string.Format(urlTemplate, zoneMapId, zoneId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Create a new zone.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public Request Create(Zone data, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Zone";
            bRequest.Content = data;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/Zones/";

            return bRequest;
        }

        /// <summary>
        /// Update an existing zone.
        /// </summary>
        /// <param name="zoneMapId"></param>
        /// <param name="zoneId"></param>
        /// <param name="zone"></param>
        /// <returns></returns>
        public Request Update(string zoneMapId, string zoneId, Zone zone, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Zone";
            bRequest.Content = zone;

            var urlTemplate = "TXN/Zones/{0},{1}";
            urlTemplate = string.Format(urlTemplate, zoneMapId, zoneId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing zone.
        /// </summary>
        /// <param name="zoneMapId"></param>
        /// <param name="zoneId"></param>
        public Request Delete(string zoneMapId, string zoneId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "TXN/Zones/{0},{1}";
            urlTemplate = string.Format(urlTemplate, zoneMapId, zoneId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Search for products based on a set of criteria.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request Search(ZoneSearchRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ZoneSearchResponses";
            bRequest.Content = request;

            bRequest.Uri = restClient.GetBaseUrl() + "TXN/Zones/Search";

            return bRequest;
        }

    }
 

 
    /// <summary>
    /// The resources and methods under /Web/Cart facilitate customer facing applications and websites for order processing and cart management. Resources here are also used by Tessitura applications such as TRBO (Tessitura Roving Box Office).
    /// </summary>
    public class CartFacade
    {
        private IRestClient restClient;

        public CartFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Cancels and clears the cart
        /// 
        /// Releases any performance and package tickets that have been added to the cart.
        /// </summary>
        /// <param name="sessionKey"></param>
        public async Task<RestResponse<NoResponse>> ClearCart(string sessionKey)
        {
             var urlTemplate = "Web/Cart/{0}/";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Releases tickets from the cart
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="performanceId">A performance Id from the cart</param>
        /// <param name="lineItemId">The lineitem of the performance to release</param>
        public async Task<RestResponse<NoResponse>> ReleaseTickets(string sessionKey, string performanceId, string lineItemId)
        {
             var urlTemplate = "Web/Cart/{0}/Tickets/{1}/{2}";
             urlTemplate = string.Format(urlTemplate, sessionKey, performanceId, lineItemId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Return a ticket by ticket number.
        /// This method is used to return tickets (generally for exchanges).  The method can also be used to donate a ticket for resale.
        /// Returning a ticket will generate a credit on the ticket order.The credit must be applied to another line item(performance, package, etc.), fee, contribution, or on account payment method.
        /// Donating a ticket uses the standard Tessitura Donate for Resale function, which releases the seat without generating a credit.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        public async Task<RestResponse<NoResponse>> ReturnTicket(string sessionKey, ReturnTicketWithNumberRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/Tickets/Return";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<ReturnTicketWithNumberRequest, NoResponse>(request);
        }

        /// <summary>
        /// Attach an existing booking to the cart.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="bookingRequest"></param>
        public async Task<RestResponse<NoResponse>> AddBooking(string sessionKey, AddBookingRequest bookingRequest)
        {
             var urlTemplate = "Web/Cart/{0}/Bookings";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<AddBookingRequest, NoResponse>(bookingRequest);
        }

        /// <summary>
        /// Remove the booking attached to the cart.
        /// </summary>
        /// <param name="sessionKey"></param>
        public async Task<RestResponse<NoResponse>> DeleteBooking(string sessionKey)
        {
             var urlTemplate = "Web/Cart/{0}/Bookings";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Return a ticket by seat number.
        /// This method is used to return tickets (generally for exchanges).  The method can also be used to donate a ticket for resale.
        /// Returning a ticket will generate a credit on the ticket order.The credit must be applied to another line item(performance, package, etc.), fee, contribution, or on account payment method.
        /// Donating a ticket uses the standard Tessitura Donate for Resale function, which releases the seat without generating a credit.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        public async Task<RestResponse<NoResponse>> ReturnTicketWithSeat(string sessionKey, ReturnTicketWithSeatRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/Tickets/ReturnWithSeat";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<ReturnTicketWithSeatRequest, NoResponse>(request);
        }

        /// <summary>
        /// Reserves tickets in cart
        /// Adds a seated or unseated performance line item to the cart and reserves seats using either the best seat function or reserves specific seats.
        /// This method will allow the reservation of held seats.To enable this functionality, add the key ''Reserve Held Seats' to T_DEFAULTS with a value of 'Yes' under the "Tessitura Web" parent table (or organization name if operating in a consortium environment).
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<ReserveTicketsResponse>> ReserveTickets(string sessionKey, ReserveTicketsRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/Tickets";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<ReserveTicketsRequest, ReserveTicketsResponse>(request);
        }

        /// <summary>
        /// Reserves tickets in cart for an existing line item
        /// PerformanceId specified must be valid for the line item
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <param name="lineItemId"></param>
        /// <returns></returns>
        public async Task<RestResponse<ReserveTicketsResponse>> ReserveTicketsForLineItem(string sessionKey, ReserveTicketsRequest request, string lineItemId)
        {
             var urlTemplate = "Web/Cart/{0}/LineItems/{1}/Tickets";
             urlTemplate = string.Format(urlTemplate, sessionKey, request);
            return await restClient.AtUrl(urlTemplate).Post<string, ReserveTicketsResponse>(lineItemId);
        }

        /// <summary>
        /// Adds a contribution to the cart
        /// The donation must be applied directly to a fund.  This method also allows a specific membership level ID to be specified.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<AddContributionResponse>> AddContribution(string sessionKey, AddContributionRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/Contributions";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<AddContributionRequest, AddContributionResponse>(request);
        }

        /// <summary>
        /// Updates a custom data value for a contribution in the cart
        /// Note: Only the Index and Value properties in the request object should be used.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="lineItemId">The Reference Number of the contribution to update the custom data value for</param>
        /// <param name="customId">The Index of the custom data value to update</param>
        /// <param name="customDataItem"></param>
        public async Task<RestResponse<NoResponse>> UpdateContributionCustomData(string sessionKey, string lineItemId, string customId, CustomDataItem customDataItem)
        {
             var urlTemplate = "Web/Cart/{0}/Contributions/{1}/CustomData/{2}";
             urlTemplate = string.Format(urlTemplate, sessionKey, lineItemId, customId);
            return await restClient.AtUrl(urlTemplate).Put<CustomDataItem, NoResponse>(customDataItem);
        }

        /// <summary>
        /// Removes a custom data value for a contribution in the cart
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="lineItemId">The Reference Number of the contribution to remove the custom data value for</param>
        /// <param name="customId">The Index of custom data value to remove</param>
        public async Task<RestResponse<NoResponse>> RemoveContributionCustomData(string sessionKey, string lineItemId, string customId)
        {
             var urlTemplate = "Web/Cart/{0}/Contributions/{1}/CustomData/{2}";
             urlTemplate = string.Format(urlTemplate, sessionKey, lineItemId, customId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Removes a contribution from the cart
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="lineItemId">The reference number of the contribution to remove.</param>
        public async Task<RestResponse<NoResponse>> RemoveContribution(string sessionKey, string lineItemId)
        {
             var urlTemplate = "Web/Cart/{0}/Contributions/{1}";
             urlTemplate = string.Format(urlTemplate, sessionKey, lineItemId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Adds a new sub package item to the cart
        /// This method is used to add a seated or unseated super package line item to the cart for the specified session by adding the component sub packages.  When the package is seated, the best seating function can be used or specific seat numbers can be passed for use with SYOS functionality.  The method must be called once for each sub package.
        /// A super package line item is created when the first sub package is added to the cart.The ID number from the super package line item is required when the remaining component sub packages are added.It is returned as SuperPackageLineItemId in the response.
        /// Super package line items can be added as alternate/upgrade line items to another super package line item in the cart.  To add an alternate/upgrade line item, the parent line item ID must be passed as the ParentSuperPackageLineItemId parameter value for this method.The parent line item ID can be retrieved using the /Web/Cart (GET) method.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<AddSubPackageItemResponse>> AddSubPackageItem(string sessionKey, AddSubPackageItemRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/Packages/Super";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<AddSubPackageItemRequest, AddSubPackageItemResponse>(request);
        }

        /// <summary>
        /// Adds a new nfs package item to the cart
        /// This method adds a seated or unseated non fixed seat (NFS) or flex package to the cart by adding the component performances.  When the package is seated, the best seating function can be used or specific seat numbers can be passed for use with SYOS functionality.
        /// A NFS or flex package line item is created when the first component performance is added to the cart.The ID number from the package line item is required when the remaining component performances are added.  It is returned as NFSPackageLineItemId in the method's response.
        /// /Web/Cart/Validation can be called at any time, setting the ValidateNFSPackages boolean to true, to determine whether all of the rules for the package have been met with items in the shopping cart.
        /// This method will allow the reservation of held seats.  To enable this functionality, add the key ''Reserve Held Seats' to T_DEFAULTS with a value of 'Yes' under the "Tessitura Web" parent table (or organization name if operating in a consortium environment).
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<AddNFSPackagePerformanceItemResponse>> AddNFSPackagePerformanceItem(string sessionKey, AddNFSPackagePerformanceItemRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/Packages/Nfs";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<AddNFSPackagePerformanceItemRequest, AddNFSPackagePerformanceItemResponse>(request);
        }

        /// <summary>
        /// Adds a new fixed seat package item to the cart
        /// Adds a seated or unseated fixed seat package line item to the cart and reserves seats using either the best seat function or reserves specific seats.
        /// PackageId line items can be added as alternate/upgrade line items to another line item in the cart.  To add an alternate/upgrade line item, the parent line item ID must be retrieved using /Web/Cart (GET) and then passed as the ParentPackageLineItemId parameter value for this method.
        /// This method will allow the reservation of held seats.To enable this functionality, add the key ''Reserve Held Seats' to T_DEFAULTS with a value of 'Yes' under the "Tessitura Web" parent table (or organization name if operating in a consortium environment).
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<AddPackageItemResponse>> AddPackageItem(string sessionKey, AddPackageItemRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/Packages/Fixed";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<AddPackageItemRequest, AddPackageItemResponse>(request);
        }

        /// <summary>
        /// Removes a fixed seat package item from the cart
        /// All seats are released for the specified package lineitem.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="packageId">Id of the packge to remove</param>
        /// <param name="lineItemId">Lineitem ID for the package line to remove</param>
        public async Task<RestResponse<NoResponse>> RemovePackageItem(string sessionKey, string packageId, string lineItemId)
        {
             var urlTemplate = "Web/Cart/{0}/Packages/Fixed/{1}/{2}";
             urlTemplate = string.Format(urlTemplate, sessionKey, packageId, lineItemId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Removes a super package item from the cart
        /// All seats are released for the specified package lineitem.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="superPackageId">Id of the package to remove</param>
        /// <param name="superPackageLineItemId">Lineitem ID of the package line to remove</param>
        public async Task<RestResponse<NoResponse>> RemoveSuperPackageItem(string sessionKey, string superPackageId, string superPackageLineItemId)
        {
             var urlTemplate = "Web/Cart/{0}/Packages/Super/{1}/{2}";
             urlTemplate = string.Format(urlTemplate, sessionKey, superPackageId, superPackageLineItemId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Removes an NFS performance item from the cart
        /// Seats are released for the specified performance in the package.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="nfsPackageLineItemId">Lineitem ID of the package to remove the performance from</param>
        /// <param name="performanceLineItemId">Lineitem ID of the performance line in the package to remove</param>
        /// <param name="performanceId">PerformanceId ID of the performance to remove</param>
        public async Task<RestResponse<NoResponse>> RemoveNFSPackagePerformanceItem(string sessionKey, string nfsPackageLineItemId, string performanceLineItemId, string performanceId)
        {
             var urlTemplate = "Web/Cart/{0}/Packages/Nfs/{1}/{2}/{3}";
             urlTemplate = string.Format(urlTemplate, sessionKey, nfsPackageLineItemId, performanceLineItemId, performanceId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Removes an entire NFS package item from the cart
        /// All seats are released for the specified package lineitem.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="nfsPackageLineItemId">The lineitem of the packge to remove</param>
        public async Task<RestResponse<NoResponse>> RemoveNFSPackage(string sessionKey, string nfsPackageLineItemId)
        {
             var urlTemplate = "Web/Cart/{0}/Packages/Nfs/{1}/";
             urlTemplate = string.Format(urlTemplate, sessionKey, nfsPackageLineItemId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Adds or Updates a fee
        /// Only user-defined fees can be added.  Seat-based fees can be overridden to zero only, while order-based or user-defined fees can be overridden to any amount, as allowed by the rules in fee setup.  To add and edit a user-defined fee call this method twice, once to add the fee, and once to override the amount.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<AddUpdateFeeResponse>> AddUpdateFee(string sessionKey, AddUpdateFeeRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/Fees";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<AddUpdateFeeRequest, AddUpdateFeeResponse>(request);
        }

        /// <summary>
        /// Removes a fee from the cart
        /// Only user-defined fees can be removed.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="itemFeeId">The Fee ID of the fee to remove</param>
        public async Task<RestResponse<NoResponse>> RemoveFee(string sessionKey, string itemFeeId)
        {
             var urlTemplate = "Web/Cart/{0}/Fees/{1}";
             urlTemplate = string.Format(urlTemplate, sessionKey, itemFeeId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Gets the cart details
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="messageTypes">A comma delimited list of valid message type ids (/ReferenceData/PricingRuleMessageTypes)</param>
        /// <param name="savedCart">Pass True if Checkout has already been called for the cart.</param>
        /// <returns></returns>
        public async Task<RestResponse<Cart>> Get(string sessionKey, string messageTypes = "null", string savedCart = "false")
        {
             var urlTemplate = "Web/Cart/{0}?messageTypes={1}&savedCart={2}";
             urlTemplate = string.Format(urlTemplate, sessionKey, messageTypes, savedCart);
            return await restClient.AtUrl(urlTemplate).Get<Cart>();
        }

        /// <summary>
        /// Gets the cart summary
        /// Used by TRBO.  Returns the cart with product lines summarized by price type, zone and price.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="messageTypes">A comma delimited list of valid message type ids (/ReferenceData/PricingRuleMessageTypes)</param>
        /// <param name="savedCart">Pass True if Checkout has already been called for the cart.</param>
        /// <returns></returns>
        public async Task<RestResponse<CartSummary>> GetSummary(string sessionKey, string messageTypes = "null", string savedCart = "false")
        {
             var urlTemplate = "Web/Cart/{0}/Summary?messageTypes={1}&savedCart={2}";
             urlTemplate = string.Format(urlTemplate, sessionKey, messageTypes, savedCart);
            return await restClient.AtUrl(urlTemplate).Get<CartSummary>();
        }

        /// <summary>
        /// Gets the pricing rule messages for the current cart.
        /// Both Message Only and Rule messages are returned.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="messageTypes">A comma delimited list of valid message type ids (/ReferenceData/PricingRuleMessageTypes)</param>
        /// <param name="savedCart">Pass True if Checkout has already been called for the cart.</param>
        /// <returns></returns>
        public async Task<RestResponse<CartPricingRuleMessages>> GetMessages(string sessionKey, string messageTypes = "null", string savedCart = "false")
        {
             var urlTemplate = "Web/Cart/{0}/Messages?messageTypes={1}&savedCart={2}";
             urlTemplate = string.Format(urlTemplate, sessionKey, messageTypes, savedCart);
            return await restClient.AtUrl(urlTemplate).Get<CartPricingRuleMessages>();
        }

        /// <summary>
        /// Returns cart properties
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <returns></returns>
        public async Task<RestResponse<CartProperties>> GetCartProperties(string sessionKey)
        {
             var urlTemplate = "Web/Cart/{0}/Properties";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Get<CartProperties>();
        }

        /// <summary>
        /// Processes checkout for the cart, using card swipe information for payment. Used by TRBO.
        /// When the method is run the status of the order is checked to ensure checkout has not started. The procedure will set the status in T_WEB_CHECKOUT to one of the following values: (S)ave in progress, (C)ompleted save, (E)rror when saving.
        /// The response includes a status and message details about the status.Possible status results are: SaveInProgress, SaveComplete, Error.
        /// In order to facilitate the use of the interceptor capability, the checkout method now makes a POST call to Txn / Orders.By default this call does nothing unless a developer has added interceptor plug -in code to the exposure.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<CheckoutResponse>> CheckoutWithCard(string sessionKey, CheckoutWithCardRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/CheckoutWithCard";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<CheckoutWithCardRequest, CheckoutResponse>(request);
        }

        /// <summary>
        /// Validates, processes payment for, and saves an order for a specified session.
        /// Payment information can be provided as follows:
        /// -	The full card details can be provided in the request
        /// -	The request includes parameters for use with the 3D Secure protocol used by credit card verification services such as Verified by Visa and MasterCard SecureCode.
        /// -	The method also allows the credit card authorization process to be skipped, which allows the use of third party authorizations.
        /// -	The AccountID property in the request can be used in place of specifying credit card information.  When a valid id value from CRM/Accounts is provided and the stored card data belongs to either the session owner or the session initiator, then that card data is passed through for authorization.If the account is invalid or does not belong to the session owner or initiator, then an error is returned.
        /// -	Additionally, this method has two additional Address Verification parameters, allowing a calling application to optionally specify the street address and zip code that represents the billing address for the credit card.
        /// 
        /// When the method is run the status of the order is checked to ensure checkout has not started. The procedure will set the status in T_WEB_CHECKOUT to one of the following values: (S)ave in progress, (C)ompleted save, (E)rror when saving.
        /// The response includes a status and message details about the status.Possible status results are: SaveInProgress, SaveComplete, Error.
        /// In order to facilitate the use of the interceptor capability, the checkout method now makes a POST call to Txn / Orders.By default this call does nothing unless a developer has added interceptor plug -in code to the exposure.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<CheckoutResponse>> Checkout(string sessionKey, CheckoutRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/Checkout";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<CheckoutRequest, CheckoutResponse>(request);
        }

        /// <summary>
        /// Price the current web cart associated with the specified sessionKey.
        /// </summary>
        /// <param name="sessionKey"></param>
        public async Task<RestResponse<NoResponse>> Price(string sessionKey)
        {
             var urlTemplate = "Web/Cart/{0}/Price";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<string, NoResponse>(sessionKey);
        }

        /// <summary>
        /// Prints tickets for specified order, lineitems, or sublineitems and returns all ticket elements.
        /// The method returns ticket data for unprinted fully-paid orders or reprints printed tickets specified via order number, one or more line item numbers, or one or more sub line item numbers.  In the case of partially-paid orders, only line items or sub line items which have been fully-paid will be eligible for printing. Only tickets belonging to the customer associated via the current web session can be returned. Ticket information can be returned in the default design specified for the ticket price type, or you may specify a ticket design to utilize via the request parameters. After the ticket data has been returned via the API, seats will be flagged as Ticketed in Tessitura.
        /// When reprinting tickets, one of the request parameters provides you with the option to regenerate the ticket number or reuse the current ticket number.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<TicketElements>> PrintTicketElements(string sessionKey, PrintOrderRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/Print/TicketElements";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<PrintOrderRequest, TicketElements>(request);
        }

        /// <summary>
        /// Prints tickets for specified order, lineitems, or sublineitems and returns a collection of formatted strings based on printer type.
        /// The returned strings can then be sent to the appropriate printer. NOTE:  Currently only Zebra printer types are supported by this method. (PrinterType = "Z")
        /// The method returns tickets for unprinted fully-paid orders or reprints printed tickets specified via order number, one or more line item numbers, or one or more sub line item numbers.  In the case of partially-paid orders, only line items or sub line items which have been fully-paid will be eligible for printing. Only tickets belonging to the customer associated via the current web session can be returned. Ticket information can be returned in the default design specified for the ticket price type, or you may specify a ticket design to utilize via the request parameters. After the tickets have been returned via the API, seats will be flagged as Ticketed in Tessitura.
        /// When reprinting tickets, one of the request parameters provides you with the option to regenerate the ticket number or reuse the current ticket number.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<PrintOrderResponse>> PrintPrintStrings(string sessionKey, PrintOrderRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/Print/PrintStrings";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<PrintOrderRequest, PrintOrderResponse>(request);
        }

        /// <summary>
        /// Prints tickets for specified order, lineitems, or sublineitems and returns a formatted html body and attachments
        /// The method returns tickets for unprinted fully-paid orders or reprints printed tickets specified via order number, one or more line item numbers, or one or more sub line item numbers.  In the case of partially-paid orders, only line items or sub line items which have been fully-paid will be eligible for printing. Only tickets belonging to the customer associated via the current web session can be returned. Ticket information can be returned in the default design specified for the ticket price type, or you may specify a ticket design to utilize via the request parameters. After the tickets have been returned via the API, seats will be flagged as Ticketed in Tessitura.
        /// When reprinting tickets, one of the request parameters provides you with the option to regenerate the ticket number or reuse the current ticket number.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="receiptSettingsId"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<EmailTicketsResponse>> PrintEmail(string sessionKey, string receiptSettingsId, PrintOrderRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/Print/Email?receiptSettingsId={1}";
             urlTemplate = string.Format(urlTemplate, sessionKey, receiptSettingsId);
            return await restClient.AtUrl(urlTemplate).Post<PrintOrderRequest, EmailTicketsResponse>(request);
        }

        /// <summary>
        /// Returns a formatted receipt for a cart
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="receiptSettingsId">ID of the receipt settings to use (ReferenceData/ReceiptSettings)</param>
        /// <param name="targetFormat">HTML for targetFormat 1 and CPCL for targetFormat 2</param>
        /// <returns></returns>
        public async Task<RestResponse<ReceiptStringResponse>> GetReceiptString(string sessionKey, string receiptSettingsId, string targetFormat = "1")
        {
             var urlTemplate = "Web/Cart/{0}/ReceiptString?receiptSettingsId={1}&targetFormat={2}";
             urlTemplate = string.Format(urlTemplate, sessionKey, receiptSettingsId, targetFormat);
            return await restClient.AtUrl(urlTemplate).Get<ReceiptStringResponse>();
        }

        /// <summary>
        /// Validates various aspects of the cart
        /// Payment Plans, Fixed Seat Packages, Non-Fixed Seat (flex) packages and Super Packages can be validated by setting the appropriate boolean in the request.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<CartValidationResponse>> Validate(string sessionKey, CartValidationRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/Validate";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<CartValidationRequest, CartValidationResponse>(request);
        }

        /// <summary>
        /// Updates cart properties
        /// See the notes on the request for specific documentation on each item that can be set.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="cartProperties"></param>
        public async Task<RestResponse<CartProperties>> UpdateCartProperties(string sessionKey, CartProperties cartProperties)
        {
             var urlTemplate = "Web/Cart/{0}/Properties";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Put<CartProperties, CartProperties>(cartProperties);
        }

        /// <summary>
        /// Updates a custom data value in the cart properties
        /// Note: Only the Index and Value properties in the request should be used.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="customId"></param>
        /// <param name="customDataItem"></param>
        public async Task<RestResponse<NoResponse>> UpdateCartPropertiesCustomData(string sessionKey, string customId, CustomDataItem customDataItem)
        {
             var urlTemplate = "Web/Cart/{0}/CustomData/{1}";
             urlTemplate = string.Format(urlTemplate, sessionKey, customId);
            return await restClient.AtUrl(urlTemplate).Put<CustomDataItem, NoResponse>(customDataItem);
        }

        /// <summary>
        /// Removes a custom data value from the cart properties
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="customId"></param>
        public async Task<RestResponse<NoResponse>> RemoveCartPropertiesCustomData(string sessionKey, string customId)
        {
             var urlTemplate = "Web/Cart/{0}/CustomData/{1}";
             urlTemplate = string.Format(urlTemplate, sessionKey, customId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Sets a payment plan on the cart using a start date, end date and a specific number of payments to be spread across the date range.
        /// The due date for the first payment is set to the entered beginning date, and the due date for subsequent payments is calculated by adding an equal number of days to each previous payment, based on the amount of time between the beginning and ending dates.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        public async Task<RestResponse<PaymentPlans>> AddPaymentPlan(string sessionKey, PaymentPlanRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/Payments/Plan/NumberOfPayments";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<PaymentPlanRequest, PaymentPlans>(request);
        }

        /// <summary>
        /// Sets a payment plan on the cart using a start date, end date and a pre-defined billing schedule.
        /// The number of payments, payment amounts, and payment due dates are calculated based on the selected billing schedule.  For details on setting up billing schedules see the TR_BILLING_SCHEDULE section of the System Tables document.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        public async Task<RestResponse<PaymentPlans>> AddPaymentPlanBasedOnBillingSchedule(string sessionKey, PaymentPlanScheduleRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/Payments/Plan/Schedule";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<PaymentPlanScheduleRequest, PaymentPlans>(request);
        }

        /// <summary>
        /// Sets a payment plan on the cart using a start date, end date and a list of installments with amount and due date.
        /// The total of the installment amounts must add up to the cart total. /Web/Cart/Validation can be used to validate that the payment plan is correct by passing True for ValidatePaymentPlan in that method.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        public async Task<RestResponse<PaymentPlans>> AddPaymentPlanInstallments(string sessionKey, PaymentPlanInstallmentRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/Payments/Plan/Installments";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<PaymentPlanInstallmentRequest, PaymentPlans>(request);
        }

        /// <summary>
        /// Applies an other payment to the cart
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<ApplyPaymentResponse>> ApplyOtherPayment(string sessionKey, ApplyOtherPaymentRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/Payments/Other";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<ApplyOtherPaymentRequest, ApplyPaymentResponse>(request);
        }

        /// <summary>
        /// Applies an invoice payment to the cart
        /// Not valid for a general public cart.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<ApplyPaymentResponse>> ApplyInvoicePayment(string sessionKey, ApplyInvoicePaymentRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/Payments/Invoice";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<ApplyInvoicePaymentRequest, ApplyPaymentResponse>(request);
        }

        /// <summary>
        /// Applies a cash payment to the cart
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<ApplyPaymentResponse>> ApplyCashPayment(string sessionKey, ApplyCashPaymentRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/Payments/Cash";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<ApplyCashPaymentRequest, ApplyPaymentResponse>(request);
        }

        /// <summary>
        /// Applies a check payment to the cart
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<ApplyPaymentResponse>> ApplyCheckPayment(string sessionKey, ApplyCheckPaymentRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/Payments/Check";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<ApplyCheckPaymentRequest, ApplyPaymentResponse>(request);
        }

        /// <summary>
        /// Applies an On Account payment to the cart.
        /// Not valid for a general public cart.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        public async Task<RestResponse<ApplyPaymentResponse>> ApplyOnAccountPayment(string sessionKey, ApplyOnAccountPaymentRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/Payments/OnAccount";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<ApplyOnAccountPaymentRequest, ApplyPaymentResponse>(request);
        }

        /// <summary>
        /// Removes a payment from the cart
        /// All payment types, except gift certificates, can be removed with this method.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="paymentId"></param>
        public async Task<RestResponse<NoResponse>> DeletePayment(string sessionKey, string paymentId)
        {
             var urlTemplate = "Web/Cart/{0}/Payments/{1}";
             urlTemplate = string.Format(urlTemplate, sessionKey, paymentId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Removes the payment plan associated with the cart
        /// </summary>
        /// <param name="sessionKey"></param>
        public async Task<RestResponse<NoResponse>> DeletePaymentPlans(string sessionKey)
        {
             var urlTemplate = "Web/Cart/{0}/Payments/Plan";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Adds a gift certificate for the specified amount to the cart
        /// The resulting gift certificate number can be found with /Web/Cart (GET).
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<CartProductResponse>> AddGiftCertificate(string sessionKey, AddGiftCertificateRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/GiftCertificates";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<AddGiftCertificateRequest, CartProductResponse>(request);
        }

        /// <summary>
        /// Removes a gift certificate product from the cart
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="giftCertificateNumber">Must be the number of a gift certificate sold in the current cart.</param>
        public async Task<RestResponse<NoResponse>> RemoveGiftCertificate(string sessionKey, string giftCertificateNumber)
        {
             var urlTemplate = "Web/Cart/{0}/GiftCertificates/{1}";
             urlTemplate = string.Format(urlTemplate, sessionKey, giftCertificateNumber);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Applies a gift certificate as payment for a cart
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<ApplyPaymentResponse>> ApplyGiftCertificate(string sessionKey, ApplyGiftCertificatePaymentRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/Payments/GiftCertificate";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<ApplyGiftCertificatePaymentRequest, ApplyPaymentResponse>(request);
        }

        /// <summary>
        /// Removes a gift certificate payment from the cart.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="giftCertificateNumber">Must be a valid gift certificate that has value applied to the cart as a payment.</param>
        public async Task<RestResponse<NoResponse>> UnapplyGiftCertificate(string sessionKey, string giftCertificateNumber)
        {
             var urlTemplate = "Web/Cart/{0}/Payments/GiftCertificate/{1}";
             urlTemplate = string.Format(urlTemplate, sessionKey, giftCertificateNumber);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Updates the source on a line item
        /// Allows the source of an individual line to be updated.  When a line is created, by reserving a tickets for a performance or package, the line source is copied from the session source. This method allows the line source to be updated.
        /// Offers and Pricing Rules consider line source, not the session source.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="lineItemId"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<SourceResponse>> UpdateLineItemSource(string sessionKey, string lineItemId, SourceRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/LineItems/{1}/Source";
             urlTemplate = string.Format(urlTemplate, sessionKey, lineItemId);
            return await restClient.AtUrl(urlTemplate).Put<SourceRequest, SourceResponse>(request);
        }

        /// <summary>
        /// Updates the price type on all sub line items for a given lineitem
        /// Can be filtered by those have a current price type as specified by OriginalPriceType
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="lineItemId">The Id of the lineitem to apply the price type to. Must be a valid lineitem in the cart.</param>
        /// <param name="request"></param>
        public async Task<RestResponse<NoResponse>> UpdateLineItemPriceType(string sessionKey, string lineItemId, UpdatePriceTypeRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/LineItems/{1}/PriceTypeId";
             urlTemplate = string.Format(urlTemplate, sessionKey, lineItemId);
            return await restClient.AtUrl(urlTemplate).Put<UpdatePriceTypeRequest, NoResponse>(request);
        }

        /// <summary>
        /// Updates the price type on a sub line item
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="subLineItemId">The Id of the sub lineitem to apply the price type to. Must be a valid sub lineitem in the cart.</param>
        /// <param name="request"></param>
        public async Task<RestResponse<NoResponse>> UpdateSubLineItemPriceType(string sessionKey, string subLineItemId, UpdatePriceTypeRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/SubLineItems/{1}/PriceTypeId";
             urlTemplate = string.Format(urlTemplate, sessionKey, subLineItemId);
            return await restClient.AtUrl(urlTemplate).Put<UpdatePriceTypeRequest, NoResponse>(request);
        }

        /// <summary>
        /// Updates the price on all sub line items for the line item
        /// A price can only be edited if the price type has been marked as editable, zones on the price map have been designated as editable, and the seat is in one of the editable zones.
        /// The status field in the response will return as S if the price can be applied or E with a description of the error if the price cannot be applied.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="lineItemId">The Id of the lineitem to apply the price to. Must be a valid lineitem in the cart.</param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<UpdatePriceResponses>> UpdateLineItemPrice(string sessionKey, string lineItemId, UpdatePriceRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/LineItems/{1}/Price";
             urlTemplate = string.Format(urlTemplate, sessionKey, lineItemId);
            return await restClient.AtUrl(urlTemplate).Put<UpdatePriceRequest, UpdatePriceResponses>(request);
        }

        /// <summary>
        /// Deletes a sub line item.
        /// Deleting not allowed for packages.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="lineItemId">The Id of the line item parent of the sub line item.</param>
        /// <param name="subLineItemId">The Id of the sub line item to delete. </param>
        public async Task<RestResponse<NoResponse>> DeleteSubLineItem(string sessionKey, string lineItemId, string subLineItemId)
        {
             var urlTemplate = "Web/Cart/{0}/LineItems/{1}/SubLineItems/{2}";
             urlTemplate = string.Format(urlTemplate, sessionKey, lineItemId, subLineItemId);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Updates the price on a sub line item.
        /// A price can only be edited if the price type has been marked as editable, zones on the price map have been designated as editable, and the seat is in one of the editable zones.
        /// The status field in the response will return as S if the price can be applied or E with a description of the error if the price cannot be applied.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="subLineItemId">The Id of the sub lineitem to apply the price to. Must be a valid sub lineitem in the cart.</param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<UpdatePriceResponse>> UpdateSubLineItemPrice(string sessionKey, string subLineItemId, UpdatePriceRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/SubLineItems/{1}/Price";
             urlTemplate = string.Format(urlTemplate, sessionKey, subLineItemId);
            return await restClient.AtUrl(urlTemplate).Put<UpdatePriceRequest, UpdatePriceResponse>(request);
        }

        /// <summary>
        /// Applies a discounted price to all sub line items for a line item
        /// For packages, the discount can only be applied to package line items.
        /// The status field in the response will return as S if the discount can be used or E with a description of the error if the discount cannot be used.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="lineItemId">The Id of the Lineitem to apply the discount to. Must be a valid lineitem in the cart.</param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<UpdatePriceResponses>> ApplyLineItemDiscount(string sessionKey, string lineItemId, ApplyDiscountRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/LineItems/{1}/Discount";
             urlTemplate = string.Format(urlTemplate, sessionKey, lineItemId);
            return await restClient.AtUrl(urlTemplate).Put<ApplyDiscountRequest, UpdatePriceResponses>(request);
        }

        /// <summary>
        /// Applies a discounted price to a sub line item
        /// 
        /// The status field in the response will return as S if the discount can be used or E with a description of the error if the discount cannot be used.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="subLineItemId">The Id of the sub lineitem to apply the discount to. Must be a valid sub lineitem in the cart.</param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<UpdatePriceResponse>> ApplySubLineItemDiscount(string sessionKey, string subLineItemId, ApplyDiscountRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/SubLineItems/{1}/Discount";
             urlTemplate = string.Format(urlTemplate, sessionKey, subLineItemId);
            return await restClient.AtUrl(urlTemplate).Put<ApplyDiscountRequest, UpdatePriceResponse>(request);
        }

        /// <summary>
        /// Updates the recipient on a sub line item
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="subLineItemId"></param>
        /// <param name="request"></param>
        public async Task<RestResponse<NoResponse>> UpdateSubLineItemRecipient(string sessionKey, string subLineItemId, UpdateRecipientRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/SubLineItems/{1}/Recipient";
             urlTemplate = string.Format(urlTemplate, sessionKey, subLineItemId);
            return await restClient.AtUrl(urlTemplate).Put<UpdateRecipientRequest, NoResponse>(request);
        }

        /// <summary>
        /// Updates Special Request info on a line item
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="lineItemId">The lineitem ID to update the special request info for</param>
        /// <param name="request"></param>
        public async Task<RestResponse<NoResponse>> UpdateLineItemSpecialRequest(string sessionKey, string lineItemId, SpecialRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/LineItems/{1}/SpecialRequest";
             urlTemplate = string.Format(urlTemplate, sessionKey, lineItemId);
            return await restClient.AtUrl(urlTemplate).Put<SpecialRequest, NoResponse>(request);
        }

        /// <summary>
        /// Validates ticket limits
        /// Offer Limits are evaluated for the specified price type and seat count using the cart source code.  Requires either a performance ID or a package ID.
        /// To enable ticket limit validation, add the Field Name "ENFORCE_SEAT_LIMIT_FOR_ORDERS" under the "Impresario" parent table with a value of "Yes." This setting applies to both the Web API and the Tessitura Client Application.
        /// </summary>
        public async Task<RestResponse<NoResponse>> ValidateLimits(string sessionKey, ValidateLimitsRequest request)
        {
             var urlTemplate = "Web/Cart/{0}/ValidateLimits";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<ValidateLimitsRequest, NoResponse>(request);
        }

    }
 

 
    /// <summary>
    /// The resources and methods under /Web/Cart facilitate customer facing applications and websites for order processing and cart management. Resources here are also used by Tessitura applications such as TRBO (Tessitura Roving Box Office).
    /// </summary>
    public class CartFacadeBatch
    {
        private IRestClient restClient;

        public CartFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Cancels and clears the cart
        /// 
        /// Releases any performance and package tickets that have been added to the cart.
        /// </summary>
        /// <param name="sessionKey"></param>
        public Request ClearCart(string sessionKey, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Web/Cart/{0}/";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Releases tickets from the cart
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="performanceId">A performance Id from the cart</param>
        /// <param name="lineItemId">The lineitem of the performance to release</param>
        public Request ReleaseTickets(string sessionKey, string performanceId, string lineItemId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Web/Cart/{0}/Tickets/{1}/{2}";
            urlTemplate = string.Format(urlTemplate, sessionKey, performanceId, lineItemId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Return a ticket by ticket number.
        /// This method is used to return tickets (generally for exchanges).  The method can also be used to donate a ticket for resale.
        /// Returning a ticket will generate a credit on the ticket order.The credit must be applied to another line item(performance, package, etc.), fee, contribution, or on account payment method.
        /// Donating a ticket uses the standard Tessitura Donate for Resale function, which releases the seat without generating a credit.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        public Request ReturnTicket(string sessionKey, ReturnTicketWithNumberRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/Tickets/Return";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Attach an existing booking to the cart.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="bookingRequest"></param>
        public Request AddBooking(string sessionKey, AddBookingRequest bookingRequest, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = bookingRequest;

            var urlTemplate = "Web/Cart/{0}/Bookings";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Remove the booking attached to the cart.
        /// </summary>
        /// <param name="sessionKey"></param>
        public Request DeleteBooking(string sessionKey, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Web/Cart/{0}/Bookings";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Return a ticket by seat number.
        /// This method is used to return tickets (generally for exchanges).  The method can also be used to donate a ticket for resale.
        /// Returning a ticket will generate a credit on the ticket order.The credit must be applied to another line item(performance, package, etc.), fee, contribution, or on account payment method.
        /// Donating a ticket uses the standard Tessitura Donate for Resale function, which releases the seat without generating a credit.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        public Request ReturnTicketWithSeat(string sessionKey, ReturnTicketWithSeatRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/Tickets/ReturnWithSeat";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Reserves tickets in cart
        /// Adds a seated or unseated performance line item to the cart and reserves seats using either the best seat function or reserves specific seats.
        /// This method will allow the reservation of held seats.To enable this functionality, add the key ''Reserve Held Seats' to T_DEFAULTS with a value of 'Yes' under the "Tessitura Web" parent table (or organization name if operating in a consortium environment).
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request ReserveTickets(string sessionKey, ReserveTicketsRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ReserveTicketsResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/Tickets";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Reserves tickets in cart for an existing line item
        /// PerformanceId specified must be valid for the line item
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <param name="lineItemId"></param>
        /// <returns></returns>
        public Request ReserveTicketsForLineItem(string sessionKey, ReserveTicketsRequest request, string lineItemId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ReserveTicketsResponse";
            bRequest.Content = lineItemId;

            var urlTemplate = "Web/Cart/{0}/LineItems/{1}/Tickets";
            urlTemplate = string.Format(urlTemplate, sessionKey, request);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Adds a contribution to the cart
        /// The donation must be applied directly to a fund.  This method also allows a specific membership level ID to be specified.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request AddContribution(string sessionKey, AddContributionRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AddContributionResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/Contributions";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Updates a custom data value for a contribution in the cart
        /// Note: Only the Index and Value properties in the request object should be used.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="lineItemId">The Reference Number of the contribution to update the custom data value for</param>
        /// <param name="customId">The Index of the custom data value to update</param>
        /// <param name="customDataItem"></param>
        public Request UpdateContributionCustomData(string sessionKey, string lineItemId, string customId, CustomDataItem customDataItem, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = customDataItem;

            var urlTemplate = "Web/Cart/{0}/Contributions/{1}/CustomData/{2}";
            urlTemplate = string.Format(urlTemplate, sessionKey, lineItemId, customId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Removes a custom data value for a contribution in the cart
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="lineItemId">The Reference Number of the contribution to remove the custom data value for</param>
        /// <param name="customId">The Index of custom data value to remove</param>
        public Request RemoveContributionCustomData(string sessionKey, string lineItemId, string customId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Web/Cart/{0}/Contributions/{1}/CustomData/{2}";
            urlTemplate = string.Format(urlTemplate, sessionKey, lineItemId, customId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Removes a contribution from the cart
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="lineItemId">The reference number of the contribution to remove.</param>
        public Request RemoveContribution(string sessionKey, string lineItemId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Web/Cart/{0}/Contributions/{1}";
            urlTemplate = string.Format(urlTemplate, sessionKey, lineItemId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Adds a new sub package item to the cart
        /// This method is used to add a seated or unseated super package line item to the cart for the specified session by adding the component sub packages.  When the package is seated, the best seating function can be used or specific seat numbers can be passed for use with SYOS functionality.  The method must be called once for each sub package.
        /// A super package line item is created when the first sub package is added to the cart.The ID number from the super package line item is required when the remaining component sub packages are added.It is returned as SuperPackageLineItemId in the response.
        /// Super package line items can be added as alternate/upgrade line items to another super package line item in the cart.  To add an alternate/upgrade line item, the parent line item ID must be passed as the ParentSuperPackageLineItemId parameter value for this method.The parent line item ID can be retrieved using the /Web/Cart (GET) method.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request AddSubPackageItem(string sessionKey, AddSubPackageItemRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AddSubPackageItemResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/Packages/Super";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Adds a new nfs package item to the cart
        /// This method adds a seated or unseated non fixed seat (NFS) or flex package to the cart by adding the component performances.  When the package is seated, the best seating function can be used or specific seat numbers can be passed for use with SYOS functionality.
        /// A NFS or flex package line item is created when the first component performance is added to the cart.The ID number from the package line item is required when the remaining component performances are added.  It is returned as NFSPackageLineItemId in the method's response.
        /// /Web/Cart/Validation can be called at any time, setting the ValidateNFSPackages boolean to true, to determine whether all of the rules for the package have been met with items in the shopping cart.
        /// This method will allow the reservation of held seats.  To enable this functionality, add the key ''Reserve Held Seats' to T_DEFAULTS with a value of 'Yes' under the "Tessitura Web" parent table (or organization name if operating in a consortium environment).
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request AddNFSPackagePerformanceItem(string sessionKey, AddNFSPackagePerformanceItemRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AddNFSPackagePerformanceItemResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/Packages/Nfs";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Adds a new fixed seat package item to the cart
        /// Adds a seated or unseated fixed seat package line item to the cart and reserves seats using either the best seat function or reserves specific seats.
        /// PackageId line items can be added as alternate/upgrade line items to another line item in the cart.  To add an alternate/upgrade line item, the parent line item ID must be retrieved using /Web/Cart (GET) and then passed as the ParentPackageLineItemId parameter value for this method.
        /// This method will allow the reservation of held seats.To enable this functionality, add the key ''Reserve Held Seats' to T_DEFAULTS with a value of 'Yes' under the "Tessitura Web" parent table (or organization name if operating in a consortium environment).
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request AddPackageItem(string sessionKey, AddPackageItemRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AddPackageItemResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/Packages/Fixed";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Removes a fixed seat package item from the cart
        /// All seats are released for the specified package lineitem.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="packageId">Id of the packge to remove</param>
        /// <param name="lineItemId">Lineitem ID for the package line to remove</param>
        public Request RemovePackageItem(string sessionKey, string packageId, string lineItemId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Web/Cart/{0}/Packages/Fixed/{1}/{2}";
            urlTemplate = string.Format(urlTemplate, sessionKey, packageId, lineItemId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Removes a super package item from the cart
        /// All seats are released for the specified package lineitem.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="superPackageId">Id of the package to remove</param>
        /// <param name="superPackageLineItemId">Lineitem ID of the package line to remove</param>
        public Request RemoveSuperPackageItem(string sessionKey, string superPackageId, string superPackageLineItemId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Web/Cart/{0}/Packages/Super/{1}/{2}";
            urlTemplate = string.Format(urlTemplate, sessionKey, superPackageId, superPackageLineItemId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Removes an NFS performance item from the cart
        /// Seats are released for the specified performance in the package.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="nfsPackageLineItemId">Lineitem ID of the package to remove the performance from</param>
        /// <param name="performanceLineItemId">Lineitem ID of the performance line in the package to remove</param>
        /// <param name="performanceId">PerformanceId ID of the performance to remove</param>
        public Request RemoveNFSPackagePerformanceItem(string sessionKey, string nfsPackageLineItemId, string performanceLineItemId, string performanceId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Web/Cart/{0}/Packages/Nfs/{1}/{2}/{3}";
            urlTemplate = string.Format(urlTemplate, sessionKey, nfsPackageLineItemId, performanceLineItemId, performanceId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Removes an entire NFS package item from the cart
        /// All seats are released for the specified package lineitem.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="nfsPackageLineItemId">The lineitem of the packge to remove</param>
        public Request RemoveNFSPackage(string sessionKey, string nfsPackageLineItemId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Web/Cart/{0}/Packages/Nfs/{1}/";
            urlTemplate = string.Format(urlTemplate, sessionKey, nfsPackageLineItemId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Adds or Updates a fee
        /// Only user-defined fees can be added.  Seat-based fees can be overridden to zero only, while order-based or user-defined fees can be overridden to any amount, as allowed by the rules in fee setup.  To add and edit a user-defined fee call this method twice, once to add the fee, and once to override the amount.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request AddUpdateFee(string sessionKey, AddUpdateFeeRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.AddUpdateFeeResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/Fees";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Removes a fee from the cart
        /// Only user-defined fees can be removed.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="itemFeeId">The Fee ID of the fee to remove</param>
        public Request RemoveFee(string sessionKey, string itemFeeId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Web/Cart/{0}/Fees/{1}";
            urlTemplate = string.Format(urlTemplate, sessionKey, itemFeeId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Gets the cart details
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="messageTypes">A comma delimited list of valid message type ids (/ReferenceData/PricingRuleMessageTypes)</param>
        /// <param name="savedCart">Pass True if Checkout has already been called for the cart.</param>
        /// <returns></returns>
        public Request Get(string sessionKey, string messageTypes = "null", string savedCart = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Cart";
            bRequest.Content = null;

            var urlTemplate = "Web/Cart/{0}?messageTypes={1}&savedCart={2}";
            urlTemplate = string.Format(urlTemplate, sessionKey, messageTypes, savedCart);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Gets the cart summary
        /// Used by TRBO.  Returns the cart with product lines summarized by price type, zone and price.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="messageTypes">A comma delimited list of valid message type ids (/ReferenceData/PricingRuleMessageTypes)</param>
        /// <param name="savedCart">Pass True if Checkout has already been called for the cart.</param>
        /// <returns></returns>
        public Request GetSummary(string sessionKey, string messageTypes = "null", string savedCart = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CartSummary";
            bRequest.Content = null;

            var urlTemplate = "Web/Cart/{0}/Summary?messageTypes={1}&savedCart={2}";
            urlTemplate = string.Format(urlTemplate, sessionKey, messageTypes, savedCart);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Gets the pricing rule messages for the current cart.
        /// Both Message Only and Rule messages are returned.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="messageTypes">A comma delimited list of valid message type ids (/ReferenceData/PricingRuleMessageTypes)</param>
        /// <param name="savedCart">Pass True if Checkout has already been called for the cart.</param>
        /// <returns></returns>
        public Request GetMessages(string sessionKey, string messageTypes = "null", string savedCart = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CartPricingRuleMessages";
            bRequest.Content = null;

            var urlTemplate = "Web/Cart/{0}/Messages?messageTypes={1}&savedCart={2}";
            urlTemplate = string.Format(urlTemplate, sessionKey, messageTypes, savedCart);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Returns cart properties
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <returns></returns>
        public Request GetCartProperties(string sessionKey, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CartProperties";
            bRequest.Content = null;

            var urlTemplate = "Web/Cart/{0}/Properties";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Processes checkout for the cart, using card swipe information for payment. Used by TRBO.
        /// When the method is run the status of the order is checked to ensure checkout has not started. The procedure will set the status in T_WEB_CHECKOUT to one of the following values: (S)ave in progress, (C)ompleted save, (E)rror when saving.
        /// The response includes a status and message details about the status.Possible status results are: SaveInProgress, SaveComplete, Error.
        /// In order to facilitate the use of the interceptor capability, the checkout method now makes a POST call to Txn / Orders.By default this call does nothing unless a developer has added interceptor plug -in code to the exposure.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request CheckoutWithCard(string sessionKey, CheckoutWithCardRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CheckoutResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/CheckoutWithCard";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Validates, processes payment for, and saves an order for a specified session.
        /// Payment information can be provided as follows:
        /// -	The full card details can be provided in the request
        /// -	The request includes parameters for use with the 3D Secure protocol used by credit card verification services such as Verified by Visa and MasterCard SecureCode.
        /// -	The method also allows the credit card authorization process to be skipped, which allows the use of third party authorizations.
        /// -	The AccountID property in the request can be used in place of specifying credit card information.  When a valid id value from CRM/Accounts is provided and the stored card data belongs to either the session owner or the session initiator, then that card data is passed through for authorization.If the account is invalid or does not belong to the session owner or initiator, then an error is returned.
        /// -	Additionally, this method has two additional Address Verification parameters, allowing a calling application to optionally specify the street address and zip code that represents the billing address for the credit card.
        /// 
        /// When the method is run the status of the order is checked to ensure checkout has not started. The procedure will set the status in T_WEB_CHECKOUT to one of the following values: (S)ave in progress, (C)ompleted save, (E)rror when saving.
        /// The response includes a status and message details about the status.Possible status results are: SaveInProgress, SaveComplete, Error.
        /// In order to facilitate the use of the interceptor capability, the checkout method now makes a POST call to Txn / Orders.By default this call does nothing unless a developer has added interceptor plug -in code to the exposure.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request Checkout(string sessionKey, CheckoutRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CheckoutResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/Checkout";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Price the current web cart associated with the specified sessionKey.
        /// </summary>
        /// <param name="sessionKey"></param>
        public Request Price(string sessionKey, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = sessionKey;

            var urlTemplate = "Web/Cart/{0}/Price";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Prints tickets for specified order, lineitems, or sublineitems and returns all ticket elements.
        /// The method returns ticket data for unprinted fully-paid orders or reprints printed tickets specified via order number, one or more line item numbers, or one or more sub line item numbers.  In the case of partially-paid orders, only line items or sub line items which have been fully-paid will be eligible for printing. Only tickets belonging to the customer associated via the current web session can be returned. Ticket information can be returned in the default design specified for the ticket price type, or you may specify a ticket design to utilize via the request parameters. After the ticket data has been returned via the API, seats will be flagged as Ticketed in Tessitura.
        /// When reprinting tickets, one of the request parameters provides you with the option to regenerate the ticket number or reuse the current ticket number.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request PrintTicketElements(string sessionKey, PrintOrderRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.TicketElements";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/Print/TicketElements";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Prints tickets for specified order, lineitems, or sublineitems and returns a collection of formatted strings based on printer type.
        /// The returned strings can then be sent to the appropriate printer. NOTE:  Currently only Zebra printer types are supported by this method. (PrinterType = "Z")
        /// The method returns tickets for unprinted fully-paid orders or reprints printed tickets specified via order number, one or more line item numbers, or one or more sub line item numbers.  In the case of partially-paid orders, only line items or sub line items which have been fully-paid will be eligible for printing. Only tickets belonging to the customer associated via the current web session can be returned. Ticket information can be returned in the default design specified for the ticket price type, or you may specify a ticket design to utilize via the request parameters. After the tickets have been returned via the API, seats will be flagged as Ticketed in Tessitura.
        /// When reprinting tickets, one of the request parameters provides you with the option to regenerate the ticket number or reuse the current ticket number.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request PrintPrintStrings(string sessionKey, PrintOrderRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PrintOrderResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/Print/PrintStrings";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Prints tickets for specified order, lineitems, or sublineitems and returns a formatted html body and attachments
        /// The method returns tickets for unprinted fully-paid orders or reprints printed tickets specified via order number, one or more line item numbers, or one or more sub line item numbers.  In the case of partially-paid orders, only line items or sub line items which have been fully-paid will be eligible for printing. Only tickets belonging to the customer associated via the current web session can be returned. Ticket information can be returned in the default design specified for the ticket price type, or you may specify a ticket design to utilize via the request parameters. After the tickets have been returned via the API, seats will be flagged as Ticketed in Tessitura.
        /// When reprinting tickets, one of the request parameters provides you with the option to regenerate the ticket number or reuse the current ticket number.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="receiptSettingsId"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request PrintEmail(string sessionKey, string receiptSettingsId, PrintOrderRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.EmailTicketsResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/Print/Email?receiptSettingsId={1}";
            urlTemplate = string.Format(urlTemplate, sessionKey, receiptSettingsId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Returns a formatted receipt for a cart
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="receiptSettingsId">ID of the receipt settings to use (ReferenceData/ReceiptSettings)</param>
        /// <param name="targetFormat">HTML for targetFormat 1 and CPCL for targetFormat 2</param>
        /// <returns></returns>
        public Request GetReceiptString(string sessionKey, string receiptSettingsId, string targetFormat = "1", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ReceiptStringResponse";
            bRequest.Content = null;

            var urlTemplate = "Web/Cart/{0}/ReceiptString?receiptSettingsId={1}&targetFormat={2}";
            urlTemplate = string.Format(urlTemplate, sessionKey, receiptSettingsId, targetFormat);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Validates various aspects of the cart
        /// Payment Plans, Fixed Seat Packages, Non-Fixed Seat (flex) packages and Super Packages can be validated by setting the appropriate boolean in the request.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request Validate(string sessionKey, CartValidationRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CartValidationResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/Validate";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Updates cart properties
        /// See the notes on the request for specific documentation on each item that can be set.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="cartProperties"></param>
        public Request UpdateCartProperties(string sessionKey, CartProperties cartProperties, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CartProperties";
            bRequest.Content = cartProperties;

            var urlTemplate = "Web/Cart/{0}/Properties";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Updates a custom data value in the cart properties
        /// Note: Only the Index and Value properties in the request should be used.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="customId"></param>
        /// <param name="customDataItem"></param>
        public Request UpdateCartPropertiesCustomData(string sessionKey, string customId, CustomDataItem customDataItem, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = customDataItem;

            var urlTemplate = "Web/Cart/{0}/CustomData/{1}";
            urlTemplate = string.Format(urlTemplate, sessionKey, customId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Removes a custom data value from the cart properties
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="customId"></param>
        public Request RemoveCartPropertiesCustomData(string sessionKey, string customId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Web/Cart/{0}/CustomData/{1}";
            urlTemplate = string.Format(urlTemplate, sessionKey, customId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Sets a payment plan on the cart using a start date, end date and a specific number of payments to be spread across the date range.
        /// The due date for the first payment is set to the entered beginning date, and the due date for subsequent payments is calculated by adding an equal number of days to each previous payment, based on the amount of time between the beginning and ending dates.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        public Request AddPaymentPlan(string sessionKey, PaymentPlanRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentPlans";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/Payments/Plan/NumberOfPayments";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Sets a payment plan on the cart using a start date, end date and a pre-defined billing schedule.
        /// The number of payments, payment amounts, and payment due dates are calculated based on the selected billing schedule.  For details on setting up billing schedules see the TR_BILLING_SCHEDULE section of the System Tables document.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        public Request AddPaymentPlanBasedOnBillingSchedule(string sessionKey, PaymentPlanScheduleRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentPlans";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/Payments/Plan/Schedule";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Sets a payment plan on the cart using a start date, end date and a list of installments with amount and due date.
        /// The total of the installment amounts must add up to the cart total. /Web/Cart/Validation can be used to validate that the payment plan is correct by passing True for ValidatePaymentPlan in that method.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        public Request AddPaymentPlanInstallments(string sessionKey, PaymentPlanInstallmentRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.PaymentPlans";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/Payments/Plan/Installments";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Applies an other payment to the cart
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request ApplyOtherPayment(string sessionKey, ApplyOtherPaymentRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ApplyPaymentResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/Payments/Other";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Applies an invoice payment to the cart
        /// Not valid for a general public cart.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request ApplyInvoicePayment(string sessionKey, ApplyInvoicePaymentRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ApplyPaymentResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/Payments/Invoice";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Applies a cash payment to the cart
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request ApplyCashPayment(string sessionKey, ApplyCashPaymentRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ApplyPaymentResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/Payments/Cash";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Applies a check payment to the cart
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request ApplyCheckPayment(string sessionKey, ApplyCheckPaymentRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ApplyPaymentResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/Payments/Check";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Applies an On Account payment to the cart.
        /// Not valid for a general public cart.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        public Request ApplyOnAccountPayment(string sessionKey, ApplyOnAccountPaymentRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ApplyPaymentResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/Payments/OnAccount";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Removes a payment from the cart
        /// All payment types, except gift certificates, can be removed with this method.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="paymentId"></param>
        public Request DeletePayment(string sessionKey, string paymentId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Web/Cart/{0}/Payments/{1}";
            urlTemplate = string.Format(urlTemplate, sessionKey, paymentId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Removes the payment plan associated with the cart
        /// </summary>
        /// <param name="sessionKey"></param>
        public Request DeletePaymentPlans(string sessionKey, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Web/Cart/{0}/Payments/Plan";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Adds a gift certificate for the specified amount to the cart
        /// The resulting gift certificate number can be found with /Web/Cart (GET).
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request AddGiftCertificate(string sessionKey, AddGiftCertificateRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.CartProductResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/GiftCertificates";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Removes a gift certificate product from the cart
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="giftCertificateNumber">Must be the number of a gift certificate sold in the current cart.</param>
        public Request RemoveGiftCertificate(string sessionKey, string giftCertificateNumber, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Web/Cart/{0}/GiftCertificates/{1}";
            urlTemplate = string.Format(urlTemplate, sessionKey, giftCertificateNumber);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Applies a gift certificate as payment for a cart
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request ApplyGiftCertificate(string sessionKey, ApplyGiftCertificatePaymentRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.ApplyPaymentResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/Payments/GiftCertificate";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Removes a gift certificate payment from the cart.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="giftCertificateNumber">Must be a valid gift certificate that has value applied to the cart as a payment.</param>
        public Request UnapplyGiftCertificate(string sessionKey, string giftCertificateNumber, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Web/Cart/{0}/Payments/GiftCertificate/{1}";
            urlTemplate = string.Format(urlTemplate, sessionKey, giftCertificateNumber);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Updates the source on a line item
        /// Allows the source of an individual line to be updated.  When a line is created, by reserving a tickets for a performance or package, the line source is copied from the session source. This method allows the line source to be updated.
        /// Offers and Pricing Rules consider line source, not the session source.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="lineItemId"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request UpdateLineItemSource(string sessionKey, string lineItemId, SourceRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SourceResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/LineItems/{1}/Source";
            urlTemplate = string.Format(urlTemplate, sessionKey, lineItemId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Updates the price type on all sub line items for a given lineitem
        /// Can be filtered by those have a current price type as specified by OriginalPriceType
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="lineItemId">The Id of the lineitem to apply the price type to. Must be a valid lineitem in the cart.</param>
        /// <param name="request"></param>
        public Request UpdateLineItemPriceType(string sessionKey, string lineItemId, UpdatePriceTypeRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/LineItems/{1}/PriceTypeId";
            urlTemplate = string.Format(urlTemplate, sessionKey, lineItemId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Updates the price type on a sub line item
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="subLineItemId">The Id of the sub lineitem to apply the price type to. Must be a valid sub lineitem in the cart.</param>
        /// <param name="request"></param>
        public Request UpdateSubLineItemPriceType(string sessionKey, string subLineItemId, UpdatePriceTypeRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/SubLineItems/{1}/PriceTypeId";
            urlTemplate = string.Format(urlTemplate, sessionKey, subLineItemId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Updates the price on all sub line items for the line item
        /// A price can only be edited if the price type has been marked as editable, zones on the price map have been designated as editable, and the seat is in one of the editable zones.
        /// The status field in the response will return as S if the price can be applied or E with a description of the error if the price cannot be applied.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="lineItemId">The Id of the lineitem to apply the price to. Must be a valid lineitem in the cart.</param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request UpdateLineItemPrice(string sessionKey, string lineItemId, UpdatePriceRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.UpdatePriceResponses";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/LineItems/{1}/Price";
            urlTemplate = string.Format(urlTemplate, sessionKey, lineItemId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Deletes a sub line item.
        /// Deleting not allowed for packages.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="lineItemId">The Id of the line item parent of the sub line item.</param>
        /// <param name="subLineItemId">The Id of the sub line item to delete. </param>
        public Request DeleteSubLineItem(string sessionKey, string lineItemId, string subLineItemId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Web/Cart/{0}/LineItems/{1}/SubLineItems/{2}";
            urlTemplate = string.Format(urlTemplate, sessionKey, lineItemId, subLineItemId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Updates the price on a sub line item.
        /// A price can only be edited if the price type has been marked as editable, zones on the price map have been designated as editable, and the seat is in one of the editable zones.
        /// The status field in the response will return as S if the price can be applied or E with a description of the error if the price cannot be applied.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="subLineItemId">The Id of the sub lineitem to apply the price to. Must be a valid sub lineitem in the cart.</param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request UpdateSubLineItemPrice(string sessionKey, string subLineItemId, UpdatePriceRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.UpdatePriceResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/SubLineItems/{1}/Price";
            urlTemplate = string.Format(urlTemplate, sessionKey, subLineItemId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Applies a discounted price to all sub line items for a line item
        /// For packages, the discount can only be applied to package line items.
        /// The status field in the response will return as S if the discount can be used or E with a description of the error if the discount cannot be used.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="lineItemId">The Id of the Lineitem to apply the discount to. Must be a valid lineitem in the cart.</param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request ApplyLineItemDiscount(string sessionKey, string lineItemId, ApplyDiscountRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.UpdatePriceResponses";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/LineItems/{1}/Discount";
            urlTemplate = string.Format(urlTemplate, sessionKey, lineItemId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Applies a discounted price to a sub line item
        /// 
        /// The status field in the response will return as S if the discount can be used or E with a description of the error if the discount cannot be used.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="subLineItemId">The Id of the sub lineitem to apply the discount to. Must be a valid sub lineitem in the cart.</param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request ApplySubLineItemDiscount(string sessionKey, string subLineItemId, ApplyDiscountRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.UpdatePriceResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/SubLineItems/{1}/Discount";
            urlTemplate = string.Format(urlTemplate, sessionKey, subLineItemId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Updates the recipient on a sub line item
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="subLineItemId"></param>
        /// <param name="request"></param>
        public Request UpdateSubLineItemRecipient(string sessionKey, string subLineItemId, UpdateRecipientRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/SubLineItems/{1}/Recipient";
            urlTemplate = string.Format(urlTemplate, sessionKey, subLineItemId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Updates Special Request info on a line item
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="lineItemId">The lineitem ID to update the special request info for</param>
        /// <param name="request"></param>
        public Request UpdateLineItemSpecialRequest(string sessionKey, string lineItemId, SpecialRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/LineItems/{1}/SpecialRequest";
            urlTemplate = string.Format(urlTemplate, sessionKey, lineItemId);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Validates ticket limits
        /// Offer Limits are evaluated for the specified price type and seat count using the cart source code.  Requires either a performance ID or a package ID.
        /// To enable ticket limit validation, add the Field Name "ENFORCE_SEAT_LIMIT_FOR_ORDERS" under the "Impresario" parent table with a value of "Yes." This setting applies to both the Web API and the Tessitura Client Application.
        /// </summary>
        public Request ValidateLimits(string sessionKey, ValidateLimitsRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Cart/{0}/ValidateLimits";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// 
    public class RegistrationFacade
    {
        private IRestClient restClient;

        public RegistrationFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Register a new user in the current session
        /// Creates a new constituent and login. Affiliates can be specified for the constituent to create a household account.
        /// The login must be unique for the login type. The session will be logged in with the new login after successful registration.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="constituent"></param>
        /// <param name="sourceId">Pass sourceId to set the source.  If not passed the source will be set to the default.</param>
        /// <returns></returns>
        public async Task<RestResponse<Session>> Register(string sessionKey, RegisterConstituent constituent, string sourceId = "null")
        {
             var urlTemplate = "Web/Registration/{0}/Register?constituent={1}";
             urlTemplate = string.Format(urlTemplate, sessionKey, constituent);
            return await restClient.AtUrl(urlTemplate).Post<string, Session>(sourceId);
        }

    }
 

 
    /// 
    public class RegistrationFacadeBatch
    {
        private IRestClient restClient;

        public RegistrationFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Register a new user in the current session
        /// Creates a new constituent and login. Affiliates can be specified for the constituent to create a household account.
        /// The login must be unique for the login type. The session will be logged in with the new login after successful registration.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="constituent"></param>
        /// <param name="sourceId">Pass sourceId to set the source.  If not passed the source will be set to the default.</param>
        /// <returns></returns>
        public Request Register(string sessionKey, RegisterConstituent constituent, string sourceId = "null", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Session";
            bRequest.Content = sourceId;

            var urlTemplate = "Web/Registration/{0}/Register?constituent={1}";
            urlTemplate = string.Format(urlTemplate, sessionKey, constituent);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

 
    /// <summary>
    /// The resources and methods under /Web (/Cart, /Session) facilitate customer facing applications and websites for login administration and cart management.  Resources here are also used by Tessitura applications such as TRBO (Tessitura Roving Box Office).
    /// </summary>
    public class SessionFacade
    {
        private IRestClient restClient;

        public SessionFacade(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Returns details summarizing a web session's state
        /// Includes counts of cart products, the login status, MOS and Source
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <returns></returns>
        public async Task<RestResponse<Session>> Get(string sessionKey)
        {
             var urlTemplate = "Web/Session/{0}";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Get<Session>();
        }

        /// <summary>
        /// Creates a new session and returns a unique session key
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<SessionResponse>> CreateSession(SessionRequest request)
        {
            return await restClient.AtUrl("Web/Session/").Post<SessionRequest, SessionResponse>(request);
        }

        /// <summary>
        /// Creates a new business-facing session and returns a unique session key
        /// A valid batch, source number and MOS must be supplied.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<SessionResponse>> CreateBusinessFacingSession(BusinessFacingSessionRequest request)
        {
            return await restClient.AtUrl("Web/Session/BusinessFacing").Post<BusinessFacingSessionRequest, SessionResponse>(request);
        }

        /// <summary>
        /// Login a constituent
        /// The method offers five options for authentication:
        /// 1 - Username and Password
        /// 2 - Email and Password
        /// 3 - Constituent ID, Phone Number and Postal Code.  Email can also be passed for additional validation but is optional.
        /// 4 - Login Token
        /// 5 - External Authentication
        /// Regardless of which authentication method is used, a constituent record must have an existing login in order for successful authentication.
        /// A login type parameter is used to determine which login is evaluated for authentication when a constituent record has more than one.  This is generally used to differentiate each organization’s logins in a consortium environment.
        /// This method sets four session variables:
        /// - UID -- The constituent ID for the session
        /// - LoginType -- The login type used for the session
        /// - UserName -- The username for the session
        /// - Status -- The status of the login (P = permanent, T = temporary)
        /// A constituent can be locked out of logging in after a certain number of failed log in attempts.  The number of failed attempts before lockout and the length of lockout are set in the T_DEFAULTS table.  Should a constituent exceed the allowed number of failed log in attempts, the method returns data on the number of failed login attempts per login along with a timestamp of the time at which the user was locked out of the login process.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        public async Task<RestResponse<Session>> Login(string sessionKey, LoginRequest request)
        {
             var urlTemplate = "Web/Session/{0}/Login";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<LoginRequest, Session>(request);
        }

        /// <summary>
        /// Logout a constituent
        /// Seats locked by the session are automatically released during logout. This behavior can be disabled by setting the DISCONNECT_ON_LOGOUT entry in T_DEFAULTS or the web.config file to False.
        /// </summary>
        /// <param name="sessionKey"></param>
        public async Task<RestResponse<NoResponse>> Logout(string sessionKey)
        {
             var urlTemplate = "Web/Session/{0}/Logout";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<string, NoResponse>(sessionKey);
        }

        /// <summary>
        /// Updates the login information for a user and logs back into the session using new credentials.
        /// 
        /// Current and new values must be submitted for login username, password, and email.  To retain any of the current values pass the same value for both the current and the new parameter.  After successfully updating the user account, the user is automatically logged in with the new login information.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<Session>> UpdateWebLogin(string sessionKey, WebLoginUpdateRequest request)
        {
             var urlTemplate = "Web/Session/{0}/WebLogins";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Put<WebLoginUpdateRequest, Session>(request);
        }

        /// <summary>
        /// Creates a webLogin for a user and logs back into the session using new credentials.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="sessionWebLogin"></param>
        /// <returns></returns>
        public async Task<RestResponse<Session>> CreateWebLogin(string sessionKey, SessionWebLogin sessionWebLogin)
        {
             var urlTemplate = "Web/Session/{0}/WebLogins";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<SessionWebLogin, Session>(sessionWebLogin);
        }

        /// <summary>
        /// Sends an email with a temporary login token to a specific email address and login type.
        /// The service searches for the email address in logins of the specified type. If it is found, the token email is sent.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<SessionWebLogin>> SendLoginCredentials(string sessionKey, SendCredentialsRequest request)
        {
             var urlTemplate = "Web/Session/{0}/Login/SendCredentials";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<SendCredentialsRequest, SessionWebLogin>(request);
        }

        /// <summary>
        /// Returns the deadline after which a session’s reserved seats will be released
        /// When called on a session without an established Seat Server session, one will be created for it.  Once the session is created, the deadline will apply regardless of whether or not any tickets have been added to the cart.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <returns></returns>
        public async Task<RestResponse<SessionExpirationResponse>> GetExpiration(string sessionKey)
        {
             var urlTemplate = "Web/Session/{0}/Expiration";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Get<SessionExpirationResponse>();
        }

        /// <summary>
        /// Changes the deadline after which a session’s reserved seats are released
        /// All times are relative to the machine on which the Tessitura Seat Server runs, including the time zone. The method either takes an absolute deadline time or an offset which is used to shorten or lengthen the time until expiration. The deadline is not the exact moment at which the seats are released, but rather when they are marked as expired. The Tessitura Seat Server will terminate the session when the next cleanup cycle is run (every 60 seconds or so). The method will return the new expiration date/time of the session.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<SessionExpirationResponse>> SetExpiration(string sessionKey, SetSessionExpirationRequest request)
        {
             var urlTemplate = "Web/Session/{0}/Expiration";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Put<SetSessionExpirationRequest, SessionExpirationResponse>(request);
        }

        /// <summary>
        /// Transfers the authentication for the specified session to another session.
        /// This method is typically called after completing checkout, so the constituent is automatically transferred to a new session.  This avoids having to log in again. NOTE:  The new session must be generated using the /Web/Session (POST) method.
        /// You can choose to have the web API automatically disconnect the constituent’s session from the Seat Server once transfer session has completed by setting the configuration value of DISCONNECT_SEAT_SERVER_SESSION_WHEN_TRANSFERING_SESSION to True in the Web API config file.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        public async Task<RestResponse<NoResponse>> TransferSession(string sessionKey, TransferSessionRequest request)
        {
             var urlTemplate = "Web/Session/{0}/Transfer";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<TransferSessionRequest, NoResponse>(request);
        }

        /// <summary>
        /// Sets the current constituent on the cart for a business facing session
        /// If the Constituent is a primary affiliate of a household, the method obeys the "TRANSACT_AS_HOUSEHOLD_ORDER" entry in T_DEFAULTS to determine if the household constituent should be set.
        /// If the default is set to "Prompt", both the household and individual are returned, to allow the user to be queried. To set the constituent to the users choice pass in the selected constituent id and set OverridePrompt to true.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<WebConstituentDisplaySummaries>> SetConstituent(string sessionKey, SetConstituentRequest request)
        {
             var urlTemplate = "Web/Session/{0}/Constituents";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Put<SetConstituentRequest, WebConstituentDisplaySummaries>(request);
        }

        /// <summary>
        /// Returns the available delivery methods for the session
        /// Delivery method availability is based on the mode of sale. NOTE:  The Hold at Box Office delivery method(ID -1) is always returned. Web code must be used to filter out this delivery method as needed.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <returns></returns>
        public async Task<RestResponse<WebDeliveryMethods>> GetDeliveryMethods(string sessionKey)
        {
             var urlTemplate = "Web/Session/{0}/DeliveryMethods";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Get<WebDeliveryMethods>();
        }

        /// <summary>
        /// Returns summary information for the specified default, including value
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="fieldName"></param>
        /// <returns></returns>
        public async Task<RestResponse<SystemDefaultSummary>> GetDefault(string sessionKey, string fieldName)
        {
             var urlTemplate = "Web/Session/{0}/Default/{1}";
             urlTemplate = string.Format(urlTemplate, sessionKey, fieldName);
            return await restClient.AtUrl(urlTemplate).Get<SystemDefaultSummary>();
        }

        /// <summary>
        /// Returns a promotion information for a session by number or description
        /// A primary use of this method is to translate promo codes (text) into source codes (integers). This method also returns the 6 fields of text that can be recorded for each web source, which can be used to display specific messaging when a promo code is entered by a constituent.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<WebPromoCodes>> GetPromoCode(string sessionKey, WebPromoCodeRequest request)
        {
             var urlTemplate = "Web/Session/{0}/PromoCode";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<WebPromoCodeRequest, WebPromoCodes>(request);
        }

        /// <summary>
        /// Returns a list of all name/value pair variables for the specified session.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <returns></returns>
        public async Task<RestResponse<SessionVariables>> GetVariables(string sessionKey)
        {
             var urlTemplate = "Web/Session/{0}/Variables";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Get<SessionVariables>();
        }

        /// <summary>
        /// Returns the value of the specified session variable.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="variableName"></param>
        /// <returns></returns>
        public async Task<RestResponse<SessionVariable>> GetVariable(string sessionKey, string variableName)
        {
             var urlTemplate = "Web/Session/{0}/Variables/{1}";
             urlTemplate = string.Format(urlTemplate, sessionKey, variableName);
            return await restClient.AtUrl(urlTemplate).Get<SessionVariable>();
        }

        /// <summary>
        /// Add a new session variable to specified session.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="sessionVariable"></param>
        /// <returns></returns>
        public async Task<RestResponse<SessionVariable>> AddVariable(string sessionKey, SessionVariable sessionVariable)
        {
             var urlTemplate = "Web/Session/{0}/Variables";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<SessionVariable, SessionVariable>(sessionVariable);
        }

        /// <summary>
        /// Update the value of an existing session variable.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="sessionVariable"></param>
        /// <returns></returns>
        public async Task<RestResponse<SessionVariable>> UpdateVariable(string sessionKey, SessionVariable sessionVariable)
        {
             var urlTemplate = "Web/Session/{0}/Variables/";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Put<SessionVariable, SessionVariable>(sessionVariable);
        }

        /// <summary>
        /// Delete an existing session variable.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="variableName"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> DeleteVariable(string sessionKey, string variableName)
        {
             var urlTemplate = "Web/Session/{0}/Variables/{1}";
             urlTemplate = string.Format(urlTemplate, sessionKey, variableName);
            return await restClient.AtUrl(urlTemplate).Delete();
        }

        /// <summary>
        /// Load an existing order into the cart and return the cart details
        /// 
        /// Once an order is loaded, changes can be made to the order.
        /// When an order is loaded the method changes the session mode of sale to the mode of sale of the loaded order.
        /// The method raises an exception if called with existing items in the cart.
        /// Locked orders cannot be loaded by this method.If the method is called for a locked order, a determination of whether or not the order is locked by an abandoned web session will be made based on the last access time of the session and the Order Lock Timeout value specified in T_DEFAULTS.  (Order Lock Timeout is the number of minutes after which to consider an idle session abandoned.)  If the session is determined to be abandoned, the order will be unlocked and loaded.
        /// This method copies an order from the real database tables to the Web Cart tables.
        /// NOTE:  All orders loaded by this procedure get a mir_lock value of -1.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="orderId">Must be a valid order Id owned by the currently session constituent.</param>
        /// <returns></returns>
        public async Task<RestResponse<Cart>> LoadOrder(string sessionKey, string orderId)
        {
             var urlTemplate = "Web/Session/{0}/LoadOrder/{1}";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<string, Cart>(orderId);
        }

        /// <summary>
        /// This method causes a Print at Home reprint request to be written for the specified order.
        /// Note that the order will only be reprinted by the Tessitura Print at Home Ticketing service if the service is configured to recognize the delivery method used by the order.
        /// The mode of sale for the order must also be set in the TR_PAHT_CONFIGURATION table to allow TPAHT reprints.
        /// See the Tessitura Print at Home Ticketing Service document for more details.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<RestResponse<NoResponse>> Reprint(string sessionKey, ReprintRequest request)
        {
             var urlTemplate = "Web/Session/{0}/Reprint/";
             urlTemplate = string.Format(urlTemplate, sessionKey);
            return await restClient.AtUrl(urlTemplate).Post<ReprintRequest, NoResponse>(request);
        }

        /// <summary>
        /// Returns the balance of on account money held by the constituent associated to the provided session key.
        /// Results can be filtered by specific on-account payment methods. The Amount used in current session is also indicated.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="paymentMethodIds">Comma separated list of ids from TR_PAYMENT_METHOD that are the on-account payment method type</param>
        /// <returns></returns>
        public async Task<RestResponse<OnAccountBalances>> GetOnAccountBalances(string sessionKey, string paymentMethodIds = "")
        {
             var urlTemplate = "Web/Session/{0}/Constituent/OnAccount?paymentMethodIds={1}";
             urlTemplate = string.Format(urlTemplate, sessionKey, paymentMethodIds);
            return await restClient.AtUrl(urlTemplate).Get<OnAccountBalances>();
        }

        /// <summary>
        /// Returns summary details for all orders belonging to the session's authenticated constituent.
        /// Returned orders can be filtered by print status, performance date, season, mode of sale, delivery method, and whether or not an order was created by a rollover.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="seasonId"></param>
        /// <param name="renewalsOnly"></param>
        /// <param name="modeOfSaleId"></param>
        /// <param name="perfStartDate"></param>
        /// <param name="perfEndDate"></param>
        /// <param name="deliveryMethodId"></param>
        /// <param name="unprintedOnly"></param>
        /// <returns></returns>
        public async Task<RestResponse<WebOrderSearchResponses>> OrderSearch(string sessionKey, string seasonId = "null", string renewalsOnly = "false", string modeOfSaleId = "null", string perfStartDate = "null", string perfEndDate = "null", string deliveryMethodId = "null", string unprintedOnly = "false")
        {
             var urlTemplate = "Web/Session/{0}/Orders/Search?seasonId={1}&renewalsOnly={2}&modeOfSaleId={3}&perfStartDate={4}&perfEndDate={5}&deliveryMethodId={6}&unprintedOnly={7}";
             urlTemplate = string.Format(urlTemplate, sessionKey, seasonId, renewalsOnly, modeOfSaleId, perfStartDate, perfEndDate, deliveryMethodId, unprintedOnly);
            return await restClient.AtUrl(urlTemplate).Get<WebOrderSearchResponses>();
        }

    }
 

 
    /// <summary>
    /// The resources and methods under /Web (/Cart, /Session) facilitate customer facing applications and websites for login administration and cart management.  Resources here are also used by Tessitura applications such as TRBO (Tessitura Roving Box Office).
    /// </summary>
    public class SessionFacadeBatch
    {
        private IRestClient restClient;

        public SessionFacadeBatch(IRestClient restClient)
        {
            this.restClient = restClient;
        }

        /// <summary>
        /// Returns details summarizing a web session's state
        /// Includes counts of cart products, the login status, MOS and Source
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <returns></returns>
        public Request Get(string sessionKey, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Session";
            bRequest.Content = null;

            var urlTemplate = "Web/Session/{0}";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Creates a new session and returns a unique session key
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request CreateSession(SessionRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SessionResponse";
            bRequest.Content = request;

            bRequest.Uri = restClient.GetBaseUrl() + "Web/Session/";

            return bRequest;
        }

        /// <summary>
        /// Creates a new business-facing session and returns a unique session key
        /// A valid batch, source number and MOS must be supplied.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request CreateBusinessFacingSession(BusinessFacingSessionRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SessionResponse";
            bRequest.Content = request;

            bRequest.Uri = restClient.GetBaseUrl() + "Web/Session/BusinessFacing";

            return bRequest;
        }

        /// <summary>
        /// Login a constituent
        /// The method offers five options for authentication:
        /// 1 - Username and Password
        /// 2 - Email and Password
        /// 3 - Constituent ID, Phone Number and Postal Code.  Email can also be passed for additional validation but is optional.
        /// 4 - Login Token
        /// 5 - External Authentication
        /// Regardless of which authentication method is used, a constituent record must have an existing login in order for successful authentication.
        /// A login type parameter is used to determine which login is evaluated for authentication when a constituent record has more than one.  This is generally used to differentiate each organization’s logins in a consortium environment.
        /// This method sets four session variables:
        /// - UID -- The constituent ID for the session
        /// - LoginType -- The login type used for the session
        /// - UserName -- The username for the session
        /// - Status -- The status of the login (P = permanent, T = temporary)
        /// A constituent can be locked out of logging in after a certain number of failed log in attempts.  The number of failed attempts before lockout and the length of lockout are set in the T_DEFAULTS table.  Should a constituent exceed the allowed number of failed log in attempts, the method returns data on the number of failed login attempts per login along with a timestamp of the time at which the user was locked out of the login process.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        public Request Login(string sessionKey, LoginRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Session";
            bRequest.Content = request;

            var urlTemplate = "Web/Session/{0}/Login";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Logout a constituent
        /// Seats locked by the session are automatically released during logout. This behavior can be disabled by setting the DISCONNECT_ON_LOGOUT entry in T_DEFAULTS or the web.config file to False.
        /// </summary>
        /// <param name="sessionKey"></param>
        public Request Logout(string sessionKey, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = sessionKey;

            var urlTemplate = "Web/Session/{0}/Logout";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Updates the login information for a user and logs back into the session using new credentials.
        /// 
        /// Current and new values must be submitted for login username, password, and email.  To retain any of the current values pass the same value for both the current and the new parameter.  After successfully updating the user account, the user is automatically logged in with the new login information.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request UpdateWebLogin(string sessionKey, WebLoginUpdateRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Session";
            bRequest.Content = request;

            var urlTemplate = "Web/Session/{0}/WebLogins";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Creates a webLogin for a user and logs back into the session using new credentials.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="sessionWebLogin"></param>
        /// <returns></returns>
        public Request CreateWebLogin(string sessionKey, SessionWebLogin sessionWebLogin, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Session";
            bRequest.Content = sessionWebLogin;

            var urlTemplate = "Web/Session/{0}/WebLogins";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Sends an email with a temporary login token to a specific email address and login type.
        /// The service searches for the email address in logins of the specified type. If it is found, the token email is sent.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request SendLoginCredentials(string sessionKey, SendCredentialsRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SessionWebLogin";
            bRequest.Content = request;

            var urlTemplate = "Web/Session/{0}/Login/SendCredentials";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Returns the deadline after which a session’s reserved seats will be released
        /// When called on a session without an established Seat Server session, one will be created for it.  Once the session is created, the deadline will apply regardless of whether or not any tickets have been added to the cart.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <returns></returns>
        public Request GetExpiration(string sessionKey, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SessionExpirationResponse";
            bRequest.Content = null;

            var urlTemplate = "Web/Session/{0}/Expiration";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Changes the deadline after which a session’s reserved seats are released
        /// All times are relative to the machine on which the Tessitura Seat Server runs, including the time zone. The method either takes an absolute deadline time or an offset which is used to shorten or lengthen the time until expiration. The deadline is not the exact moment at which the seats are released, but rather when they are marked as expired. The Tessitura Seat Server will terminate the session when the next cleanup cycle is run (every 60 seconds or so). The method will return the new expiration date/time of the session.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request SetExpiration(string sessionKey, SetSessionExpirationRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SessionExpirationResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Session/{0}/Expiration";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Transfers the authentication for the specified session to another session.
        /// This method is typically called after completing checkout, so the constituent is automatically transferred to a new session.  This avoids having to log in again. NOTE:  The new session must be generated using the /Web/Session (POST) method.
        /// You can choose to have the web API automatically disconnect the constituent’s session from the Seat Server once transfer session has completed by setting the configuration value of DISCONNECT_SEAT_SERVER_SESSION_WHEN_TRANSFERING_SESSION to True in the Web API config file.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        public Request TransferSession(string sessionKey, TransferSessionRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Session/{0}/Transfer";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Sets the current constituent on the cart for a business facing session
        /// If the Constituent is a primary affiliate of a household, the method obeys the "TRANSACT_AS_HOUSEHOLD_ORDER" entry in T_DEFAULTS to determine if the household constituent should be set.
        /// If the default is set to "Prompt", both the household and individual are returned, to allow the user to be queried. To set the constituent to the users choice pass in the selected constituent id and set OverridePrompt to true.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request SetConstituent(string sessionKey, SetConstituentRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WebConstituentDisplaySummaries";
            bRequest.Content = request;

            var urlTemplate = "Web/Session/{0}/Constituents";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Returns the available delivery methods for the session
        /// Delivery method availability is based on the mode of sale. NOTE:  The Hold at Box Office delivery method(ID -1) is always returned. Web code must be used to filter out this delivery method as needed.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <returns></returns>
        public Request GetDeliveryMethods(string sessionKey, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WebDeliveryMethods";
            bRequest.Content = null;

            var urlTemplate = "Web/Session/{0}/DeliveryMethods";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Returns summary information for the specified default, including value
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="fieldName"></param>
        /// <returns></returns>
        public Request GetDefault(string sessionKey, string fieldName, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SystemDefaultSummary";
            bRequest.Content = null;

            var urlTemplate = "Web/Session/{0}/Default/{1}";
            urlTemplate = string.Format(urlTemplate, sessionKey, fieldName);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Returns a promotion information for a session by number or description
        /// A primary use of this method is to translate promo codes (text) into source codes (integers). This method also returns the 6 fields of text that can be recorded for each web source, which can be used to display specific messaging when a promo code is entered by a constituent.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request GetPromoCode(string sessionKey, WebPromoCodeRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WebPromoCodes";
            bRequest.Content = request;

            var urlTemplate = "Web/Session/{0}/PromoCode";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Returns a list of all name/value pair variables for the specified session.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <returns></returns>
        public Request GetVariables(string sessionKey, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SessionVariables";
            bRequest.Content = null;

            var urlTemplate = "Web/Session/{0}/Variables";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Returns the value of the specified session variable.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="variableName"></param>
        /// <returns></returns>
        public Request GetVariable(string sessionKey, string variableName, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SessionVariable";
            bRequest.Content = null;

            var urlTemplate = "Web/Session/{0}/Variables/{1}";
            urlTemplate = string.Format(urlTemplate, sessionKey, variableName);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Add a new session variable to specified session.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="sessionVariable"></param>
        /// <returns></returns>
        public Request AddVariable(string sessionKey, SessionVariable sessionVariable, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SessionVariable";
            bRequest.Content = sessionVariable;

            var urlTemplate = "Web/Session/{0}/Variables";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Update the value of an existing session variable.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="sessionVariable"></param>
        /// <returns></returns>
        public Request UpdateVariable(string sessionKey, SessionVariable sessionVariable, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "PUT";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.SessionVariable";
            bRequest.Content = sessionVariable;

            var urlTemplate = "Web/Session/{0}/Variables/";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Delete an existing session variable.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="variableName"></param>
        /// <returns></returns>
        public Request DeleteVariable(string sessionKey, string variableName, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "DELETE";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = null;

            var urlTemplate = "Web/Session/{0}/Variables/{1}";
            urlTemplate = string.Format(urlTemplate, sessionKey, variableName);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Load an existing order into the cart and return the cart details
        /// 
        /// Once an order is loaded, changes can be made to the order.
        /// When an order is loaded the method changes the session mode of sale to the mode of sale of the loaded order.
        /// The method raises an exception if called with existing items in the cart.
        /// Locked orders cannot be loaded by this method.If the method is called for a locked order, a determination of whether or not the order is locked by an abandoned web session will be made based on the last access time of the session and the Order Lock Timeout value specified in T_DEFAULTS.  (Order Lock Timeout is the number of minutes after which to consider an idle session abandoned.)  If the session is determined to be abandoned, the order will be unlocked and loaded.
        /// This method copies an order from the real database tables to the Web Cart tables.
        /// NOTE:  All orders loaded by this procedure get a mir_lock value of -1.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="orderId">Must be a valid order Id owned by the currently session constituent.</param>
        /// <returns></returns>
        public Request LoadOrder(string sessionKey, string orderId, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.Cart";
            bRequest.Content = orderId;

            var urlTemplate = "Web/Session/{0}/LoadOrder/{1}";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// This method causes a Print at Home reprint request to be written for the specified order.
        /// Note that the order will only be reprinted by the Tessitura Print at Home Ticketing service if the service is configured to recognize the delivery method used by the order.
        /// The mode of sale for the order must also be set in the TR_PAHT_CONFIGURATION table to allow TPAHT reprints.
        /// See the Tessitura Print at Home Ticketing Service document for more details.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public Request Reprint(string sessionKey, ReprintRequest request, List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "POST";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.NoResponse";
            bRequest.Content = request;

            var urlTemplate = "Web/Session/{0}/Reprint/";
            urlTemplate = string.Format(urlTemplate, sessionKey);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Returns the balance of on account money held by the constituent associated to the provided session key.
        /// Results can be filtered by specific on-account payment methods. The Amount used in current session is also indicated.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="paymentMethodIds">Comma separated list of ids from TR_PAYMENT_METHOD that are the on-account payment method type</param>
        /// <returns></returns>
        public Request GetOnAccountBalances(string sessionKey, string paymentMethodIds = "", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.OnAccountBalances";
            bRequest.Content = null;

            var urlTemplate = "Web/Session/{0}/Constituent/OnAccount?paymentMethodIds={1}";
            urlTemplate = string.Format(urlTemplate, sessionKey, paymentMethodIds);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

        /// <summary>
        /// Returns summary details for all orders belonging to the session's authenticated constituent.
        /// Returned orders can be filtered by print status, performance date, season, mode of sale, delivery method, and whether or not an order was created by a rollover.
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="seasonId"></param>
        /// <param name="renewalsOnly"></param>
        /// <param name="modeOfSaleId"></param>
        /// <param name="perfStartDate"></param>
        /// <param name="perfEndDate"></param>
        /// <param name="deliveryMethodId"></param>
        /// <param name="unprintedOnly"></param>
        /// <returns></returns>
        public Request OrderSearch(string sessionKey, string seasonId = "null", string renewalsOnly = "false", string modeOfSaleId = "null", string perfStartDate = "null", string perfEndDate = "null", string deliveryMethodId = "null", string unprintedOnly = "false", List<DependsOnRequest> dependsOnRequests = null)
        {
            var bRequest = new Request();
            bRequest.DependsOnRequests = dependsOnRequests;
            bRequest.Id = 0;
            bRequest.ContinueOnError = false;
            bRequest.HttpMethod = "GET";
            bRequest.ReturnTypeString = "Tessitura.Service.Contract.WebOrderSearchResponses";
            bRequest.Content = null;

            var urlTemplate = "Web/Session/{0}/Orders/Search?seasonId={1}&renewalsOnly={2}&modeOfSaleId={3}&perfStartDate={4}&perfEndDate={5}&deliveryMethodId={6}&unprintedOnly={7}";
            urlTemplate = string.Format(urlTemplate, sessionKey, seasonId, renewalsOnly, modeOfSaleId, perfStartDate, perfEndDate, deliveryMethodId, unprintedOnly);

            bRequest.Uri = restClient.GetBaseUrl() + urlTemplate;

            return bRequest;
        }

    }
 

}