### Get Notifications C# Example Source: https://github.com/danielklecha/sharpippnext/blob/master/docs/Content/Client/GetNotifications.md Instantiate the client, create a request, and asynchronously retrieve notifications. Ensure the SharpIppClient is properly initialized. ```csharp var client = new SharpIppClient(); var request = new GetNotificationsRequest(); var response = await client.GetNotificationsAsync(request); ``` -------------------------------- ### Get Subscriptions C# Example Source: https://github.com/danielklecha/sharpippnext/blob/master/docs/Content/Client/GetSubscriptions.md Instantiate the SharpIppClient, create a GetSubscriptionsRequest, and asynchronously retrieve subscriptions. ```csharp var client = new SharpIppClient(); var request = new GetSubscriptionsRequest(); var response = await client.GetSubscriptionsAsync(request); ``` -------------------------------- ### Install SharpIppNext Package Source: https://context7.com/danielklecha/sharpippnext/llms.txt Install the SharpIppNext NuGet package using the .NET CLI. Choose the standard or strong-named variant as needed. ```bash dotnet add package SharpIppNext # or for the strong-named variant: dotnet add package SharpIppNext.StrongName ``` -------------------------------- ### Install Resource using SharpIppClient Source: https://github.com/danielklecha/sharpippnext/blob/master/docs/Content/Client/InstallResource.md Use this snippet to install a resource on an IPP device. Ensure you have a SharpIppClient instance and a properly configured InstallResourceRequest. ```csharp var client = new SharpIppClient(); var request = new InstallResourceRequest { OperationAttributes = new InstallResourceOperationAttributes { SystemUri = new Uri("ipp://127.0.0.1:8631/system"), RequestingUserName = "admin", ResourceId = 1001 } }; var response = await client.InstallResourceAsync(request); ``` -------------------------------- ### Example contact-vcard Member Attribute Source: https://github.com/danielklecha/sharpippnext/blob/master/docs/Content/Specification/pwg5100.11-2024-docling.md Illustrates the structure of a 'contact-vcard' member attribute using PAPI encoding, with each line of the vCard conveyed in its own text(MAX) value. The PHOTO value is truncated for brevity. ```text contact-vcard = "BEGIN:VCARD\r\n", "VERSION:4.0\r\n", "UID:urn:uuid:85a872f4-6635-4b56-9a38-26d76566e9c6\r\n", "KIND:individual\r\n", "FN;PID=1.1:Alex Doe\r\n", "N:Doe;Alex;;;\r\n", "ORG:Example Corp\r\n", "TITLE:IT Support Specialist\r\n", "EMAIL;PID=1.1:adoe@example.com\r\n", "TEL;VALUE=uri;TYPE=work:tel:+1-000-555-1212\r\n", "PHOTO:data:image/jpeg;base64,... \n", "END:VCARD\r\n" ``` -------------------------------- ### Get Printer Attributes C# Example Source: https://github.com/danielklecha/sharpippnext/blob/master/docs/Content/Client/GetPrinterAttributes.md Initializes a GetPrinterAttributesRequest and sends it to the printer. Ensure the SharpIppClient is properly initialized and the printer URI is correct. This example omits optional attributes for clarity. ```csharp using System; using System.Threading.Tasks; using SharpIpp; using SharpIpp.Models.Requests; var client = new SharpIppClient(); // Initialize the get printer attributes request with required operation attributes var request = new GetPrinterAttributesRequest { OperationAttributes = new() { PrinterUri = new Uri("ipp://localhost:631/printers/my-printer") } }; // Send the request and await the response var response = await client.GetPrinterAttributesAsync(request); Console.WriteLine($"Printer State: {response.PrinterAttributes.PrinterState}"); ``` -------------------------------- ### Startup-One-Printer Request Example Source: https://github.com/danielklecha/sharpippnext/blob/master/docs/Content/Client/StartupOnePrinter.md This C# snippet shows how to instantiate a SharpIppClient, create a StartupOnePrinterRequest, and send it asynchronously. Ensure the SharpIppClient is properly configured before use. ```csharp var client = new SharpIppClient(); var request = new StartupOnePrinterRequest(); var response = await client.StartupOnePrinterAsync(request); ``` -------------------------------- ### Build SharpIppNext Project Source: https://github.com/danielklecha/sharpippnext/blob/master/CONTRIBUTING.md Build the project using the .NET CLI. Ensure you use the Release configuration for building. ```bash dotnet build --configuration Release ``` -------------------------------- ### Get System Attributes C# Example Source: https://github.com/danielklecha/sharpippnext/blob/master/docs/Content/Client/GetSystemAttributes.md Instantiate the SharpIppClient, create a GetSystemAttributesRequest, and call GetSystemAttributesAsync to retrieve system attributes. ```csharp var client = new SharpIppClient(); var request = new GetSystemAttributesRequest(); var response = await client.GetSystemAttributesAsync(request); ``` -------------------------------- ### Install SharpIppNext via NuGet Source: https://github.com/danielklecha/sharpippnext/blob/master/README.md Use this command to add the SharpIppNext library to your .NET project. ```bash dotnet add package SharpIppNext ``` -------------------------------- ### Install Resource Source: https://github.com/danielklecha/sharpippnext/blob/master/docs/Content/Client/Operations.md Installs a resource on the printer. ```APIDOC ## InstallResourceAsync ### Description Installs a resource on the printer. ### Method `InstallResourceAsync` ``` -------------------------------- ### Initiate All Printers with SharpIppClient Source: https://github.com/danielklecha/sharpippnext/blob/master/docs/Content/Client/StartupAllPrinters.md Use this snippet to send the StartupAllPrinters request to the IPP server. Ensure the SharpIppClient is properly initialized. ```csharp var client = new SharpIppClient(); var request = new StartupAllPrintersRequest(); var response = await client.StartupAllPrintersAsync(request); ``` -------------------------------- ### SetPrinterAttributesAsync Example Source: https://github.com/danielklecha/sharpippnext/blob/master/docs/Content/Client/SetPrinterAttributes.md This example shows how to update printer description attributes using `SetPrinterAttributesAsync`. ```APIDOC ## SetPrinterAttributesAsync ### Description Updates printer description attributes. ### Method `SetPrinterAttributesAsync` ### Parameters #### Request Body - **request** (SetPrinterAttributesRequest) - Required - The request object containing operation and printer attributes. ### Request Example ```csharp var request = new SetPrinterAttributesRequest { OperationAttributes = new() { PrinterUri = new Uri("ipp://localhost:631/printers/my-printer"), AttributesCharset = "utf-8", AttributesNaturalLanguage = "en", RequestingUserName = "alice" }, PrinterAttributes = new PrinterDescriptionAttributes { PrinterInfo = "Main floor – color" } }; ``` ### Response #### Success Response - **response** (SetPrinterAttributesResponse) - The response from the server indicating the result of the operation. ### Notes - Supply only settable printer attributes; immutable attributes will be rejected by compliant implementations. - The server decides which attributes were applied and may return `successful-ok-ignored-or-substituted-attributes` or `successful-ok-conflicting-attributes` when appropriate. ``` -------------------------------- ### Create System Subscriptions with SharpIppClient Source: https://github.com/danielklecha/sharpippnext/blob/master/docs/Content/Client/CreateSystemSubscriptions.md Instantiate the SharpIppClient and send a CreateSystemSubscriptionsRequest to the IPP server. Ensure the client is properly initialized before making the request. ```csharp var client = new SharpIppClient(); var request = new CreateSystemSubscriptionsRequest(); var response = await client.CreateSystemSubscriptionsAsync(request); ``` -------------------------------- ### Install IPP Server Packages Source: https://github.com/danielklecha/sharpippnext/wiki/IPP-server-tests Installs the cups-client and cups-backends packages required for IPP server testing. ```bash sudo zypper install cups-client cups-backends ``` -------------------------------- ### Get Output Device Attributes Source: https://github.com/danielklecha/sharpippnext/blob/master/docs/Content/Client/GetOutputDeviceAttributes.md Use this snippet to get output device attributes. Ensure SharpIppClient is initialized. ```csharp var client = new SharpIppClient(); var request = new GetOutputDeviceAttributesRequest(); var response = await client.GetOutputDeviceAttributesAsync(request); ``` -------------------------------- ### IPP Natural Language Examples Source: https://github.com/danielklecha/sharpippnext/blob/master/docs/Content/Specification/rfc2911-2000-docling.md Shows examples of natural language identifiers for IPP attributes. Values must be all lowercase. ```text 'en': for English 'en-us': for US English 'fr': for French 'de': for German ```