Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SessionTimeOut - I166 enhancement #212

Merged
merged 4 commits into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Intacct.SDK.Tests/Xml/Response/AuthenticationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ public void SuccessTest()
<userid>fakeuser</userid>
<companyid>fakecompany</companyid>
<locationid></locationid>
<clientid>clientCompanyId</clientid>
<clientstatus>active</clientstatus>
<sessiontimestamp>2015-10-24T18:56:52-07:00</sessiontimestamp>
<sessiontimeout>2015-10-24T22:56:52-07:00</sessiontimeout>
</authentication>
<result>
<status>success</status>
Expand Down Expand Up @@ -58,6 +61,10 @@ public void SuccessTest()
Assert.Equal("success", auth.Status);
Assert.Equal("fakeuser", auth.UserId);
Assert.Equal("fakecompany", auth.CompanyId);
Assert.Equal("clientCompanyId", auth.ClientId);
Assert.Equal("active", auth.ClientStatus);
Assert.Equal("2015-10-24T18:56:52-07:00", auth.SessionTimeStamp);
Assert.Equal("2015-10-24T22:56:52-07:00", auth.SessionTimeOut);
Assert.Equal("", auth.EntityId);
}

Expand Down
33 changes: 31 additions & 2 deletions Intacct.SDK/Xml/Response/Authentication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ public class Authentication
public string CompanyId { get; }

public string EntityId { get; }

public string ClientStatus { get; }

public string ClientId { get; }

public string SessionTimeStamp { get; }

public string SessionTimeOut { get; }

public Authentication(XElement authentication)
{
Expand Down Expand Up @@ -56,9 +64,30 @@ public Authentication(XElement authentication)
{
this.EntityId = entityId.Value;
}


// TODO add getter/setter for elements: clientstatus, clientid, sessiontimestamp
var clientStatus = authentication.Element("clientstatus");
if (clientStatus != null)
{
this.ClientStatus = clientStatus.Value;
}

var clientId = authentication.Element("clientid");
if (clientStatus != null)
{
this.ClientId = clientId.Value;
}

var sessionTimeStamp = authentication.Element("sessiontimestamp");
if (sessionTimeStamp != null)
{
this.SessionTimeStamp = sessionTimeStamp.Value;
}

var sessionTimeOut = authentication.Element("sessiontimeout");
if (sessionTimeOut != null)
{
this.SessionTimeOut = sessionTimeOut.Value;
}
}
}
}