Skip to content

Commit

Permalink
Added EffortClassChargeID and StandardServiceRequestActivityID
Browse files Browse the repository at this point in the history
  • Loading branch information
klaasvandeweerdt committed Jan 27, 2023
1 parent 49041f5 commit 6fe1b9a
Show file tree
Hide file tree
Showing 8 changed files with 425 additions and 1 deletion.
9 changes: 9 additions & 0 deletions Source/Sdk4me.Tests/ServiceLevelAgreementTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,18 @@ public void Get()

if (serviceLevelAgreements.Count == 0)
return;

ServiceLevelAgreement serviceLevelAgreement = serviceLevelAgreements[Random.Shared.Next(serviceLevelAgreements.Count)];
Trace.WriteLine($"Continue relation tests on service level agreement: {serviceLevelAgreement.Name}");

List<EffortClassChargeID> effortClassChargeID = client.ServiceLevelAgreements.GetEffortClassChargeIDs(serviceLevelAgreement, "*");
Assert.IsNotNull(effortClassChargeID);
Assert.IsInstanceOfType(effortClassChargeID, typeof(List<EffortClassChargeID>));

List<StandardServiceRequestActivityID> standardServiceRequestActivityIDs = client.ServiceLevelAgreements.GetStandardServiceRequestActivityIDs(serviceLevelAgreement, "*");
Assert.IsNotNull(standardServiceRequestActivityIDs);
Assert.IsInstanceOfType(standardServiceRequestActivityIDs, typeof(List<StandardServiceRequestActivityID>));

List<Person> people = client.ServiceLevelAgreements.GetCustomerRepresentatives(serviceLevelAgreement, "*");
Assert.IsNotNull(people);
Assert.IsInstanceOfType(people, typeof(List<Person>));
Expand Down
20 changes: 20 additions & 0 deletions Source/Sdk4me.Tests/TimeEntryTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;

namespace Sdk4me.Tests
{
[TestClass]
public class TimeEntryTest
{
[TestMethod]
public void Get()
{
Sdk4meClient client = Client.Get();
List<TimeEntry> timeEntries = client.TimeEntries.Get("*");
Console.WriteLine($"Count: {timeEntries.Count}");
Assert.IsNotNull(timeEntries);
Assert.IsInstanceOfType(timeEntries, typeof(List<TimeEntry>));
}
}
}
73 changes: 73 additions & 0 deletions Source/Sdk4me/Entities/EffortClassChargeID.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
using Newtonsoft.Json;
using System;

namespace Sdk4me
{
/// <summary>
/// A 4me <see href="https://developer.4me.com/v1/service_level_agreements/effort_class_chargeIDs/">Service Level Agreements - Effort Class Charge ID</see> object.
/// </summary>
public class EffortClassChargeID : BaseItem
{
private string chargeID;
private EffortClass effortClass;

#region Created at (override)

/// <summary>
/// The creation date and time; which is obsolete for this object.
/// </summary>
[JsonProperty("created_at"), Sdk4meIgnoreInFieldSelection()]
public override DateTime? CreatedAt
{
get => base.CreatedAt;
internal set => base.CreatedAt = null;
}

#endregion

#region Updated at (override)

/// <summary>
/// The updated date and time; which is obsolete for this object.
/// </summary>
[JsonProperty("updated_at"), Sdk4meIgnoreInFieldSelection()]
public override DateTime? UpdatedAt
{
get => base.UpdatedAt;
internal set => base.UpdatedAt = null;
}

#endregion

#region ChargeID

/// <summary>
/// The Charge ID is the unique identifier by which an effort class that is linked to a time entry when an activity was performed through the coverage of the SLA is known in the billing system of the service provider.
/// </summary>
[JsonProperty("chargeID")]
public string ChargeID
{
get => chargeID;
set => chargeID = SetValue("chargeID", chargeID, value);
}

#endregion

#region Effort class ID

/// <summary>
/// The effort class related to the effort class charge ID.
/// </summary>
[JsonProperty("effort_class")]
public EffortClass EffortClass
{
get => effortClass;
set => effortClass = SetValue("effort_class_id", effortClass, value);
}

[JsonProperty("effort_class_id"), Sdk4meIgnoreInFieldSelection()]
internal long? EffortClassID => effortClass?.ID;

#endregion
}
}
105 changes: 105 additions & 0 deletions Source/Sdk4me/Entities/ServiceLevelAgreement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ namespace Sdk4me
/// </summary>
public class ServiceLevelAgreement : BaseItem
{
private string activityidLow;
private string activityidMedium;
private string activityidHigh;
private string activityidTop;
private string activityidRfc;
private string activityidRfi;
private List<Attachment> attachments;
private string billingID;
private ServiceLevelCoverage? coverage;
private Organization customer;
private AccountReference customerAccount;
Expand All @@ -27,6 +34,90 @@ public class ServiceLevelAgreement : BaseItem
private ServiceLevelAgreementStatus? status;
private bool useKnowledgeFromServiceProvider;

#region Activityid low

/// <summary>
/// Represents the activityID for low incidents. The Activity ID is the unique identifier by which an activity that is performed in the context of a service offering is known in the billing system of the service provider.
/// </summary>
[JsonProperty("activityID_low")]
public string ActivityidLow
{
get => activityidLow;
set => activityidLow = SetValue("activityID_low", activityidLow, value);
}

#endregion

#region Activityid medium

/// <summary>
/// Represents the activityID for medium incidents. The Activity ID is the unique identifier by which an activity that is performed in the context of a service offering is known in the billing system of the service provider.
/// </summary>
[JsonProperty("activityID_medium")]
public string ActivityidMedium
{
get => activityidMedium;
set => activityidMedium = SetValue("activityID_medium", activityidMedium, value);
}

#endregion

#region Activityid high

/// <summary>
/// Represents the activityID for high incidents. The Activity ID is the unique identifier by which an activity that is performed in the context of a service offering is known in the billing system of the service provider.
/// </summary>
[JsonProperty("activityID_high")]
public string ActivityidHigh
{
get => activityidHigh;
set => activityidHigh = SetValue("activityID_high", activityidHigh, value);
}

#endregion

#region Activityid top

/// <summary>
/// Represents the activityID for top incidents. The Activity ID is the unique identifier by which an activity that is performed in the context of a service offering is known in the billing system of the service provider.
/// </summary>
[JsonProperty("activityID_top")]
public string ActivityidTop
{
get => activityidTop;
set => activityidTop = SetValue("activityID_top", activityidTop, value);
}

#endregion

#region Activityid rfc

/// <summary>
/// Represents the activityID for RFCs. The Activity ID is the unique identifier by which an activity that is performed in the context of a service offering is known in the billing system of the service provider.
/// </summary>
[JsonProperty("activityID_rfc")]
public string ActivityidRfc
{
get => activityidRfc;
set => activityidRfc = SetValue("activityID_rfc", activityidRfc, value);
}

#endregion

#region Activityid rfi

/// <summary>
/// Represents the activityID for RFIs. The Activity ID is the unique identifier by which an activity that is performed in the context of a service offering is known in the billing system of the service provider.
/// </summary>
[JsonProperty("activityID_rfi")]
public string ActivityidRfi
{
get => activityidRfi;
set => activityidRfi = SetValue("activityID_rfi", activityidRfi, value);
}

#endregion

#region Attachments

/// <summary>
Expand All @@ -41,6 +132,20 @@ public List<Attachment> Attachments

#endregion

#region BillingID

/// <summary>
/// The Billing ID is the unique identifier by which all the activities that are performed through the coverage of the SLA are known in the billing system of the service provider.
/// </summary>
[JsonProperty("billingID")]
public string BillingID
{
get => billingID;
set => billingID = SetValue("billingID", billingID, value);
}

#endregion

#region Coverage

/// <summary>
Expand Down
73 changes: 73 additions & 0 deletions Source/Sdk4me/Entities/StandardServiceRequestActivityID.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
using Newtonsoft.Json;
using System;

namespace Sdk4me
{
/// <summary>
/// A 4me <see href="https://developer.4me.com/v1/service_level_agreements/standard_service_request_activityIDs/">Service Level Agreements - Standard Service Request Activity ID</see> object.
/// </summary>
public class StandardServiceRequestActivityID : BaseItem
{
private string activityID;
private StandardServiceRequest standardServiceRequest;

#region Created at (override)

/// <summary>
/// The creation date and time; which is obsolete for this object.
/// </summary>
[JsonProperty("created_at"), Sdk4meIgnoreInFieldSelection()]
public override DateTime? CreatedAt
{
get => base.CreatedAt;
internal set => base.CreatedAt = null;
}

#endregion

#region Updated at (override)

/// <summary>
/// The updated date and time; which is obsolete for this object.
/// </summary>
[JsonProperty("updated_at"), Sdk4meIgnoreInFieldSelection()]
public override DateTime? UpdatedAt
{
get => base.UpdatedAt;
internal set => base.UpdatedAt = null;
}

#endregion

#region ActivityID

/// <summary>
/// The Activity ID is the unique identifier by which an activity that is performed in the context of a service offering is known in the billing system of the service provider.
/// </summary>
[JsonProperty("activityID")]
public string ActivityID
{
get => activityID;
set => activityID = SetValue("activityID", activityID, value);
}

#endregion

#region Standard service request

/// <summary>
/// The standard service request related to the standard service request activity ID.
/// </summary>
[JsonProperty("standard_service_request")]
public StandardServiceRequest StandardServiceRequest
{
get => standardServiceRequest;
set => standardServiceRequest = SetValue("standard_service_request_id", standardServiceRequest, value);
}

[JsonProperty("standard_service_request_id"), Sdk4meIgnoreInFieldSelection()]
internal long? StandardServiceRequestID => standardServiceRequest?.ID;

#endregion
}
}
45 changes: 45 additions & 0 deletions Source/Sdk4me/Entities/TimeEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ namespace Sdk4me
/// </summary>
public class TimeEntry : BaseItem
{
private string activityID;
private string billingID;
private string chargeID;
private bool correction;
private float? cost;
private string costCurrency;
Expand All @@ -30,6 +33,48 @@ public class TimeEntry : BaseItem
private TimeAllocation timeAllocation;
private int timeSpent;

#region ActivityID

/// <summary>
/// The Activity ID is the unique identifier by which an activity that is performed in the context of a service offering is known in the billing system of the service provider. Some examples of activities are standard requests, a high impact incident or a request for information. The Activity ID can be used to support integrations between the billing system of the service provider and the 4me account in which the activities are performed.
/// </summary>
[JsonProperty("activityID")]
public string ActivityID
{
get => activityID;
internal set => activityID = value;
}

#endregion

#region BillingID

/// <summary>
/// The Billing ID is the unique identifier by which all the activities that are performed through the coverage of the SLA are known in the billing system of the service provider. The billing ID can be used to support integrations between the billing system of the service provider and the 4me account in which the activities are performed.
/// </summary>
[JsonProperty("billingID")]
public string BillingID
{
get => billingID;
internal set => billingID = value;
}

#endregion

#region ChargeID

/// <summary>
/// The Charge ID is the unique identifier by which an effort class that is linked to a time entry when an activity was performed through the coverage of the SLA is known in the billing system of the service provider. The effort class represents the type of effort that was performed when working on an activity. Some examples of effort classes are ‘Billable - Normal Hours’, ‘Billable overtime’, ‘Non Billable’ or ‘Senior System Engineer’. The Charge ID can be used to support integrations between the billing system of the service provider and the 4me account in which the activities are performed. In the billing system the Charge IDs will be linked to the rates that have been agreed on in the service contract.
/// </summary>
[JsonProperty("chargeID")]
public string ChargeID
{
get => chargeID;
internal set => chargeID = value;
}

#endregion

#region Correction

/// <summary>
Expand Down
5 changes: 4 additions & 1 deletion Source/Sdk4me/Extensions/To4meStringExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ internal static class To4meStringExtension
"supplierRequestID",
"supportID",
"systemID",
"supplier_requestID"
"supplier_requestID",
"billingID",
"activityID",
"chargeID"
};

/// <summary>
Expand Down
Loading

0 comments on commit 6fe1b9a

Please sign in to comment.