/// <summary> /// Example: Obtaining a lock and getting lock information /// </summary> private static void LoanLock() { if (_accessToken == null) { Authenticate(); } ResourceLocksApi lockApiClient = ApiClientProvider.GetApiClient <ResourceLocksApi>(_accessToken); Console.Write("Enter the LoanId: "); var loanId = Console.ReadLine(); //This contract will get us lock on a loan and this will be a forced lock. var request = new ResourceLockContract { Resource = new ResourceLockContractResource { EntityType = "loan", EntityId = loanId }, LockType = "shared" }; var createResponse = lockApiClient.CreateResourceLockWithHttpInfo("false", "id", request); //Example of pasrsing the URL _lockId = createResponse.Headers["Location"].Split('/')[3]; var getResponse = lockApiClient.GetResourceLockByLockId(_lockId, "loan", loanId); Console.WriteLine("Lock ID: {0}", getResponse.Id); }
/// <summary> /// Example: Unlock Loan /// </summary> private static void DeleteLock() { if (_accessToken == null) { Authenticate(); } ResourceLocksApi lockApiClient = ApiClientProvider.GetApiClient <ResourceLocksApi>(_accessToken); lockApiClient.Unlock(_lockId, "loan", LoanId, "true"); }
public void Init() { instance = new ResourceLocksApi(); }