AAU.Ta3leem.Sdk 1.1.20.6
Ta3leem SDK
A .NET SDK for integrating with the Ta3leem API.
Note: The SDK uses .NET resilience standards for HTTP calls to ensure reliability and fault tolerance.
Configuration
Add the SDK to your service registration (e.g., in Startup.cs or Program.cs):
using ta3leem_sdk;
public void ConfigureServices(IServiceCollection services)
{
var config = new Te3leemConfig(
BaseUrl: "your-api-base-url",
ClientId: "your-client-id",
ClientSecret: "your-client-secret",
IsSecure: true, // or false
ApiVersion: 1 // or your desired version
);
services.AddTa3leemSdk(config);
}
This registers the HTTP client and all related services for dependency injection.
Usage Example
// Inject IGovernorateService via constructor or service provider
var request = new Ta3leemBaseRequest
{
PerPage = 20,
Page = 1,
Search = "Baghdad" // Optional
};
var result = await governorateService.GetListAsync(request);
if (result.IsSuccess)
{
var governorates = result.Payload.Data;
// Use the governorates list
}
else
{
Console.WriteLine($"Error: {result.Message}");
}
Response Models
- GovernorateName.cs:
NameObject(Arabic/English) - GovernorateResponse.cs: Governorate info (
Id,Name,UpdatedAt) - OrganizationResponse.cs: Organization info (
Id,Code,Name,ParentId,UnitType,Governorate,IsPrivate,LastModificationDate) - UnitTypeResponse.cs: Unit type info (
Id,Name,CodingSystemLength,IsDeleted,DeletedAt,CreatedAt,LastModificationDate) - StudyYearResponse.cs: Study year info (
Id,Name,IsCurrent,IsDeleted,DeletedAt,CreatedAt,LastModificationDate) - Ta3leemListBaseResponse.cs: Generic list response (
Status,RequestTraceId,Message,PayloadwithDataandPagination)
Services (Admin)
IGovernorateService
Task<Ta3leemListBaseResponse<GovernorateResponse>> GetListAsync(Ta3leemBaseRequest request, CancellationToken cancellationToken = default)
- Request: Ta3leemBaseRequest
- Response: Ta3leemListBaseResponse<GovernorateResponse>
IOrganizationService
Task<Ta3leemListBaseResponse<OrganizationResponse>> GetListAsync(Ta3leemBaseRequest request, CancellationToken cancellationToken = default)
- Request: Ta3leemBaseRequest
- Response: Ta3leemListBaseResponse<OrganizationResponse>
IUnitTypeService
Task<Ta3leemListBaseResponse<UnitTypeResponse>> GetListAsync(Ta3leemBaseRequest request, CancellationToken cancellationToken = default)
- Request: Ta3leemBaseRequest
- Response: Ta3leemListBaseResponse<UnitTypeResponse>
IStudyYearService
Task<Ta3leemListBaseResponse<StudyYearResponse>> GetListAsync(Ta3leemBaseRequest request, CancellationToken cancellationToken = default)
- Request: Ta3leemBaseRequest
- Response: Ta3leemListBaseResponse<StudyYearResponse>
No packages depend on AAU.Ta3leem.Sdk.
.NET 9.0
- AAU.Extensions (>= 1.0.0.61)
- Microsoft.Extensions.Http (>= 9.0.6)
- Microsoft.Extensions.Http.Resilience (>= 9.6.0)
- Microsoft.Extensions.Resilience (>= 9.6.0)
- Newtonsoft.Json (>= 13.0.3)