AnointedAutomation.Objects 2.5.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package AnointedAutomation.Objects --version 2.5.0
                    
NuGet\Install-Package AnointedAutomation.Objects -Version 2.5.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AnointedAutomation.Objects" Version="2.5.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AnointedAutomation.Objects" Version="2.5.0" />
                    
Directory.Packages.props
<PackageReference Include="AnointedAutomation.Objects" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AnointedAutomation.Objects --version 2.5.0
                    
#r "nuget: AnointedAutomation.Objects, 2.5.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AnointedAutomation.Objects@2.5.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AnointedAutomation.Objects&version=2.5.0
                    
Install as a Cake Addin
#tool nuget:?package=AnointedAutomation.Objects&version=2.5.0
                    
Install as a Cake Tool

AnointedAutomation.Objects

Jesus is King ✝️

Plain C# models shared across AnointedAutomation services: user accounts and profiles, billing and payment records, Google sign in payloads, and standard API response envelopes. The classes carry no database attributes, so the same types work with MongoDB, SQL or plain JSON.

NuGet Downloads

Installation

dotnet add package AnointedAutomation.Objects

Quick start

using System.Collections.Generic;
using AnointedAutomation.Objects;
using AnointedAutomation.Objects.Account;
using AnointedAutomation.Objects.Billing;

User user = new User
{
    UserId = "u_123",
    Email = "user@example.com",
    Username = "johndoe",
    Role = "member",
    Profile = new Profile { FirstName = "John", LastName = "Doe" }
};

// Typed response envelope with status-code factories.
ResponseData<User> ok = ResponseData<User>.Ok(user, "User loaded");
ResponseData<User> missing = ResponseData<User>.NotFound("No such user");

// Paged results: totalPages, hasNextPage and hasPreviousPage are computed.
PaginatedResponse<User> page = new PaginatedResponse<User>(new List<User> { user }, currentPage: 1, pageSize: 20, totalItems: 41);

// Card helpers.
bool looksValid = CreditCard.ValidateLuhn("4242424242424242");
string masked = CreditCard.MaskCardNumber("4242424242424242");

API overview

Responses (AnointedAutomation.Objects)

Type Description
ResponseData Untyped envelope: Message, Data, Error, success, Timestamp (ISO 8601 UTC), plus fixed Anointed, Automation, Copyright, Links and Trinity fields. The (string message, object data, object error) constructor sets success from whether Error is null.
ResponseData<T> Typed envelope with Data, Message, statusCode, success, Timestamp, and static factories Ok, Created, Accepted, NoContent, Error, BadRequest, Unauthorized, Forbidden, NotFound, Conflict, UnprocessableEntity, TooManyRequests, InternalServerError, ServiceUnavailable.
PaginatedResponse<T> Data, currentPage, pageSize, totalItems, totalPages, hasNextPage, hasPreviousPage.
ChristianEmoticons String constants such as LatinCross, PrayingHands, Dove, Bible, Fish.

Account (AnointedAutomation.Objects.Account)

Type Description
User Account record: UserId, Email (mirrors the primary Emails entry), Emails, Username, Password, Role, Profile, Token, tokenExpiration, emailConfirmed, IPAddresses, Friends, FriendId, BlockedUsers, isBanned, banned, BannedReason, createdDate, lastActiveDate, timeOnline, SSO, Meta, and account deletion fields (deletionDate, DeletionConfirmationCode, deletionConfirmationExpiration). Constructors: parameterless; a full constructor taking every settable property in declaration (BSON) order and assigning each exactly as passed (no defaults); and the legacy 14-parameter constructor, which defaults banned to 1900-01-01, createdDate/lastActiveDate to DateTime.UtcNow, a null IPAddresses to empty and a null Profile to new. A null password is accepted by both (SSO-only accounts).
UserEmail One address on a user: Address (lower-cased, trimmed), Verified, VerifiedAt, IsPrimary, Source, AddedAt.
UserEmailSource Enum: Unknown (0), Manual, Signup, Google, Microsoft, Apple, Facebook, Shopify, Merge, Admin, Discord.
Profile Extends Billing.Contact (FirstName, MiddleName, LastName, dob, number) with a Newtonsoft JObject AccountSettings.
Credentials Login payload: Email, Password, Token, GoogleToken.
IPInfo Login history for one IP: IpAddress, firstLogin, lastLogin, loginCount, timeOnline.

Billing (AnointedAutomation.Objects.Billing)

Type Description
Purchase Order with addresses, Item (Product), discounts, tax, tip, total, TransactionId, OrderStatus (TransactionStatus) and a StatusHistory; UpdateOrderStatus(newStatus, changedBy, reason) records each change.
Subscription Extends Purchase with Status (SubscriptionStatus), billing period, trial, pause/cancel dates, per metric Usage, and lifecycle methods Pause, Resume, Cancel, Renew, UpdateStatus, IsUsable, IsTrialing, CalculateNextBillingDate, GetDaysRemaining, AddUsageMetric, UpdateUsage, IsOverUsageLimit.
SubscriptionUsage Metered usage: Limit, Used, Remaining, UsagePercentage, IsOverLimit, IsNearLimit, IncrementUsage, DecrementUsage, ResetForNewPeriod.
StatusHistoryEntry One status transition: PreviousStatus, NewStatus, ChangedBy, Reason, Timestamp.
Bill A customer's billing record: AdressBilling, Orders, PaymentTypesOnFile, Purchases, Refunds, Subscriptions.
Product, Sale, Inventory Catalog, sales and stock records. Product.GetTotalQuantitySold(products, sales) totals sales per product.
Address, Contact Postal address and person/contact details.
CreditCard Card details with IsValid, IsExpired, ValidateLuhn, static DetectCardType (CardType), static MaskCardNumber, GetDisplayString and ToSecureObject (strips sensitive data).
PaymentCredentials, PayeeInfo Payment method on file (CreditCard, PayeeInfo, paymentType).
PaymentIntent, PaymentCustomer, PaymentMethodToken, Refund, Dispute Provider agnostic payment records, each tagged with a PaymentProvider and the provider's own id. Amounts are long minor units.
WebhookEvent A received provider webhook (Provider, EventType, RawPayload, IsProcessed, ProcessingError, Signature).
PaymentAuditLog Request/response audit record for a provider call; SetRequestBody and SetResponseBody pass bodies through the static MaskSensitiveData, and CalculateDuration fills DurationMs.
DisputeStatus Enum of dispute states.

Google (AnointedAutomation.Objects.Google)

Type Description
GoogleObjects Holds GoogleTokenInfo and UserProfile; stored on User.Google.
GoogleTokenInfo Google token response and token info fields, mapped with [JsonProperty] to Google's snake_case names.
UserProfile Google user info (id, email, verifiedEmail, name, givenName, familyName, picture, locale, hd, ...).

Discord (AnointedAutomation.Objects.Discord)

Type Description
DiscordLogin Holds the Discord User; stored on User.SSO.Discord.
DiscordUser Discord's full documented User object as /users/@me returns it (id, username, discriminator, global_name, avatar, bot, system, mfa_enabled, banner, accent_color, locale, verified, email, flags, premium_type, public_flags, avatar_decoration_data, collectibles, primary_guild), mapped with [JsonProperty] to Discord's snake_case names.
DiscordAvatarDecorationData, DiscordCollectibles, DiscordNameplate, DiscordPrimaryGuild The nested Discord user structures.

Naming convention

Properties follow the AnointedAutomation hybrid casing: value types are camelCase (success, statusCode, createdDate) and reference types are PascalCase (Message, Data, Email). The companion serializers in AnointedAutomation.Objects.API (JsonCasingConvention) and AnointedAutomation.Repository.Mongo (HybridElementNameConvention) keep the JSON wire and the database on the same rule.

Storing these models

The models have no MongoDB or EF Core attributes. For MongoDB, call BsonClassMapRegistrar.RegisterClassMaps() from AnointedAutomation.Repository.Mongo at startup; it maps User.UserId to _id and registers a serializer for the JObject in Profile.AccountSettings.

License

MIT. See LICENSE.

Support This Project

This library is free and open source. The best way to support the work is to shop with us:

Found a bug or have a request? Open an issue at https://github.com/AnointedAutomation/AnointedAutomation/issues.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on AnointedAutomation.Objects:

Package Downloads
AnointedAutomation.Repository.Mongo

A MongoDB helper and generic repository base for .NET, with CRUD, paging, aggregation, index management, BSON class maps and casing conventions.

AnointedAutomation.Objects.API

ASP.NET Core helpers: an in memory IFormFile, a hybrid casing System.Text.Json naming convention, and a GraphQL response envelope reader.

AnointedAutomation.Objects.Mongo

MongoDB-specific objects with BSON attributes - AnointedAutomation.Objects.Mongo

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.7.1 127 10/26/2026
2.7.0 329 10/16/2026
2.6.1 86 10/16/2026
2.6.0 91 10/16/2026
2.5.0 93 10/15/2026
2.4.0 335 10/1/2026
2.3.1 107 10/1/2026
2.3.0 100 10/1/2026
2.2.1 240 10/1/2026
2.2.0 151 10/1/2026
2.1.5 124 9/29/2026
2.1.4 101 9/29/2026
2.1.3 284 9/25/2026
2.1.2 620 8/23/2026
2.1.1 350 7/27/2026
2.1.0 186 7/26/2026
2.0.0 311 7/2/2026
1.0.3 338 6/30/2026
1.0.2 653 6/20/2026
1.0.1 423 5/30/2026
Loading failed