### Get Invoice Summary Example Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/profiles-and-invoices.md Example of how to retrieve the current invoice summary and print the account balance and currency. ```java InvoiceSummary summary = invoices.getSummary().get(); System.out.println("Balance: " + summary.getAccountBalance()); System.out.println("Currency: " + summary.getCurrencyCode()); ``` -------------------------------- ### Get Invoice Summaries Example Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/profiles-and-invoices.md Example of how to retrieve all invoice summaries and iterate through them, printing the account balance for each. ```java ResourceCollection summaries = invoices.getSummaries().get(); for (InvoiceSummary summary : summaries.getItems()) { System.out.println("Balance: " + summary.getAccountBalance()); } ``` -------------------------------- ### Get Single Invoice Details Example Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/profiles-and-invoices.md Example of how to get operations for a specific invoice by its ID and then retrieve its details. ```java IInvoice invoice = partnerOperations.getInvoices().byId("invoice-id-123"); Invoice details = invoice.get(); ``` -------------------------------- ### Get License Deployment Insights Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/analytics-and-rate-cards.md Obtain partner license deployment insights, which provide information on the distribution of licenses across customers. This example demonstrates fetching the deployment insight records. ```java IPartnerLicensesDeploymentInsightsCollection deployment = licenses.getDeploymentInsights(); // Get deployment insight records ResourceCollection records = deployment.get(); ``` -------------------------------- ### Query Invoices Example Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/profiles-and-invoices.md Example of how to build a simple query with a page size and retrieve filtered invoices. ```java IQuery query = QueryFactory.getInstance().buildSimpleQuery(); query.setPageSize(25); ResourceCollection invoices = partnerOperations.getInvoices().query(query); ``` -------------------------------- ### Retrieve All Invoices Example Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/profiles-and-invoices.md Example of how to retrieve all invoices and iterate through them, printing basic invoice details. ```java IInvoiceCollection invoices = partnerOperations.getInvoices(); ResourceCollection allInvoices = invoices.get(); for (Invoice invoice : allInvoices.getItems()) { System.out.println("Invoice: " + invoice.getId()); System.out.println("Amount: " + invoice.getInvoiceAmount()); System.out.println("Currency: " + invoice.getCurrencyCode()); } ``` -------------------------------- ### Complete Partner SDK Configuration Example Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/configuration.md This example demonstrates how to configure the Partner SDK, including setting up proxy options, a credential refresh handler, and retrieving configuration details. It also shows how to create a configured partner operations object with a specific request context. ```java public class PartnerSDKConfiguration { public static void configurePartnerSDK() { PartnerService service = PartnerService.getInstance(); // Configure proxy if needed String proxyHost = System.getenv("PROXY_HOST"); if (proxyHost != null) { Integer proxyPort = Integer.parseInt(System.getenv("PROXY_PORT", "8080")); service.setProxyOptions(proxyHost, proxyPort); } // Set up credential refresh handler service.setRefreshCredentialsHandler(new AutoRefreshingCredentials()); // Get configuration Configuration config = service.getConfiguration(); System.out.println("SDK Version: " + service.getSdkVersion()); System.out.println("API Root: " + service.getApiRootUrl()); System.out.println("API Version: " + service.getPartnerServiceApiVersion()); System.out.println("Max Retries: " + config.getDefaultMaxRetryAttempts()); System.out.println("Token Expiry Buffer: " + config.getDefaultAuthenticationTokenExpiryBufferInSeconds() + " seconds"); System.out.println("Default Locale: " + config.getDefaultLocale()); } public static IPartner createConfiguredPartner(IPartnerCredentials credentials) { PartnerService service = PartnerService.getInstance(); // Configure SDK configurePartnerSDK(); // Create partner operations IAggregatePartner partner = service.createPartnerOperations(credentials); // Create request context with specific locale IRequestContext context = new RequestContext(); context.setLocaleCode("en-US"); context.setCorrelationId(UUID.randomUUID().toString()); // Return scoped partner operations return partner.with(context); } } ``` -------------------------------- ### Get Product SKUs Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/products-and-offers.md Gets the SKUs (Stock Keeping Units) available for this product. ```APIDOC ## Get Product SKUs ### Description Gets the SKUs (Stock Keeping Units) available for this product. ### Method ```java ISkuCollection getSkus() ``` ### Returns `ISkuCollection` - SKU operations ### Example ```java ISkuCollection skus = product.getSkus(); ResourceCollection allSkus = skus.get(); ``` ``` -------------------------------- ### Get Offers Paginated Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/products-and-offers.md Retrieves offers with pagination, allowing you to fetch offers in batches. Specify the starting index and the maximum number of offers to return. ```java ResourceCollection pagedOffers = partnerOperations.getOffers().byCountry("US").get(0, 100); ``` -------------------------------- ### Get Product Details Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/products-and-offers.md Retrieves the details of a specific product. ```APIDOC ## Get Product Details ### Description Retrieves the product details. ### Method ```java Product get() ``` ### Returns `Product` - The product information ### Example ```java Product product = partnerOperations.getProducts().byCountry("US") .byId("microsoft-365-business-standard").get(); System.out.println("Title: " + product.getTitle()); System.out.println("Description: " + product.getDescription()); ``` ``` -------------------------------- ### Get Offers by Category Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/products-and-offers.md Gets offers filtered by a specific category identifier. Use this to retrieve offers belonging to a particular category, such as 'software'. ```java ResourceCollection softwareOffers = partnerOperations.getOffers().byCountry("US") .byCategory("software").get(); ``` -------------------------------- ### Get Customer Products Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/customers.md Retrieves products available to a specific customer. ```APIDOC ## Customer Products ### Description Gets products available to this customer. ### Method GET ### Endpoint /customers/{customerId}/products ### Returns ICustomerProductCollection - Customer products operations ``` -------------------------------- ### Get Configuration Policies Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/customers.md Retrieves device configuration policies for a specific customer. ```APIDOC ## Device Deployment - Configuration Policies ### Description Gets device configuration policies for the customer. ### Method GET ### Endpoint /customers/{customerId}/configurationpolicies ### Returns IConfigurationPolicyCollection - Configuration policy operations ``` -------------------------------- ### Get Customer Products Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/customers.md Retrieves operations for accessing products available to the customer. ```java ICustomerProductCollection products = partnerOperations.getCustomers().byId("customer-id-123").getProducts(); ``` -------------------------------- ### Get Customer Usage Summary Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/customers.md Retrieves the customer's overall usage summary. ```java ICustomerUsageSummary usageSummary = partnerOperations.getCustomers().byId("customer-id-123").getUsageSummary(); ``` -------------------------------- ### Get Single Product by ID Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/products-and-offers.md Retrieves operations for a specific product using its unique identifier. The 'get()' method on the returned object fetches the product details. ```java IProduct product = partnerOperations.getProducts().byCountry("US").byId("product-id"); Product details = product.get(); ``` -------------------------------- ### Get Single Product Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/products-and-offers.md Gets operations for a specific product using its unique identifier. Allows retrieval of detailed information for a single product. ```APIDOC ## Get Single Product ### Description Gets operations for a specific product. ### Method N/A (Java SDK method) ### Endpoint N/A (Java SDK method) ### Parameters #### Path Parameters - **productId** (String) - Required - The product identifier #### Query Parameters N/A #### Request Body N/A ### Request Example ```java IProduct product = partnerOperations.getProducts().byCountry("US").byId("product-id"); Product details = product.get(); ``` ### Response #### Success Response `IProduct` - Product-specific operations #### Response Example N/A ``` -------------------------------- ### Build Partner Center SDK from Command Line Source: https://github.com/microsoft/partner-center-java/blob/master/README.md Execute this Maven command to clean and package the Partner Center SDK. This is typically done after cloning the repository. ```bash mvn clean package ``` -------------------------------- ### Get Usage Summary Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/analytics-and-rate-cards.md Retrieves the partner's usage summary, including costs and spending details. ```APIDOC ## Get Usage Summary ### Description Gets the partner's usage summary including costs and spending. ### Method Signature ```java public PartnerUsageSummary get() ``` ### Returns `PartnerUsageSummary` - The usage summary ### Example ```java PartnerUsageSummary summary = partnerOperations.getUsageSummary().get(); System.out.println("Spending Budget: " + summary.getSpendingBudget()); System.out.println("Estimated Spending: " + summary.getEstimatedSpending()); System.out.println("Currency: " + summary.getCurrencyCode()); System.out.println("Usage Date: " + summary.getUsageDate()); ``` ``` -------------------------------- ### Building and Configuring a Simple Query Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/types.md Demonstrates how to use the QueryFactory to build a simple query instance, set its page size, and apply a filter. ```java IQuery simpleQuery = QueryFactory.getInstance().buildSimpleQuery(); simpleQuery.setPageSize(50); simpleQuery.setFilter(QueryFactory.getInstance().buildSimpleFilter("status", "active")); ``` -------------------------------- ### Get Customer Device Batches Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/customers.md Retrieves operations for managing device batches for deployment for the customer. ```java IDevicesBatchCollection deviceBatches = partnerOperations.getCustomers().byId("customer-id-123").getDeviceBatches(); ``` -------------------------------- ### Complete Order and Subscription Workflow in Java Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/orders-and-subscriptions.md This snippet demonstrates a full workflow for creating an order, retrieving its details, accessing associated subscriptions, updating a subscription, and retrieving usage records. It covers order creation, subscription retrieval, and basic subscription management operations. ```java PartnerService partnerService = PartnerService.getInstance(); IAggregatePartner partner = partnerService.createPartnerOperations(credentials); String customerId = "customer-id-123"; ICustomer customer = partner.getCustomers().byId(customerId); // Create an order Order newOrder = new Order(); newOrder.setReferenceCustomerId(customerId); newOrder.setBillingCycle(BillingCycleType.MONTHLY); newOrder.setCurrencyCode("USD"); OrderLineItem item = new OrderLineItem(); item.setLineItemNumber(1); item.setOfferId("MS-AZR-0145P"); item.setQuantity(5); item.setBillingCycle(BillingCycleType.MONTHLY); newOrder.setLineItems(Arrays.asList(item)); Order createdOrder = customer.getOrders().create(newOrder); System.out.println("Order created: " + createdOrder.getId()); // Retrieve the order Order orderDetails = customer.getOrders().byId(createdOrder.getId()).get(); System.out.println("Order Status: " + orderDetails.getStatus()); // Get subscriptions created from the order ResourceCollection orderSubscriptions = customer.getSubscriptions().byOrder(createdOrder.getId()).get(); for (Subscription sub : orderSubscriptions.getItems()) { System.out.println("Subscription: " + sub.getId()); System.out.println("Status: " + sub.getStatus()); System.out.println("Quantity: " + sub.getQuantity()); // Update subscription friendly name sub.setFriendlyName("Production - Office 365"); Subscription updated = customer.getSubscriptions().byId(sub.getId()).patch(sub); // Get usage for the subscription ISubscriptionMonthlyUsageRecordCollection usageRecords = customer.getSubscriptions().byId(sub.getId()).getUsageRecords(); } // Get all subscriptions ResourceCollection allSubscriptions = customer.getSubscriptions().get(); System.out.println("Total subscriptions: " + allSubscriptions.getItems().size()); ``` -------------------------------- ### AzureMeter Name Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/analytics-and-rate-cards.md Gets or sets the name of the meter. Example: "Compute Hours". ```Java public String getName() public void setName(String value) ``` -------------------------------- ### Get Customer Usage Summary Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/customers.md Retrieves the usage summary for a specific customer. ```APIDOC ## Customer Usage Summary ### Description Gets the customer's usage summary. ### Method GET ### Endpoint /customers/{customerId}/usagesummary ### Returns ICustomerUsageSummary - Usage summary operations ``` -------------------------------- ### Get Authentication Token String Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/partner-service-and-operations.md Retrieves the raw authentication token string. ```java public String getToken() ``` -------------------------------- ### AzureRateCard Locale Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/analytics-and-rate-cards.md Gets or sets the locale of the rate card. Example: "en-US". ```Java public String getLocale() public void setLocale(String value) ``` -------------------------------- ### Get Device Batches Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/customers.md Retrieves device batch operations for deployment for a specific customer. ```APIDOC ## Device Deployment - Device Batches ### Description Gets device batch operations for deployment. ### Method GET ### Endpoint /customers/{customerId}/devicebatches ### Returns IDevicesBatchCollection - Device batch operations ``` -------------------------------- ### Get Customer Offers Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/customers.md Retrieves offers available to a specific customer. ```APIDOC ## Customer Offers ### Description Gets offers available to this customer. ### Method GET ### Endpoint /customers/{customerId}/offers ### Returns ICustomerOfferCollection - Customer offers operations ``` -------------------------------- ### Configure Partner Service from Environment Variables Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/configuration.md Implements SDK configuration by reading settings like proxy host, proxy port, API root URL, and default locale from environment variables. ```java public class EnvironmentConfiguredPartnerService { public static void configureFromEnvironment(PartnerService service) { // Proxy from environment String proxyHost = System.getenv("PARTNER_SDK_PROXY_HOST"); String proxyPort = System.getenv("PARTNER_SDK_PROXY_PORT"); if (proxyHost != null && proxyPort != null) { service.setProxyOptions(proxyHost, Integer.parseInt(proxyPort)); } // API root from environment String apiRoot = System.getenv("PARTNER_SDK_API_ROOT"); if (apiRoot != null) { service.setApiRootUrl(apiRoot); } // Default locale from environment String locale = System.getenv("PARTNER_SDK_LOCALE"); if (locale != null) { service.getConfiguration().setDefaultLocale(locale); } } } ``` -------------------------------- ### AzureRateCard Currency Code Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/analytics-and-rate-cards.md Gets or sets the currency code for the rate card. Example: "USD". ```Java public String getCurrencyCode() public void setCurrencyCode(String value) ``` -------------------------------- ### Initialize Partner Service SDK Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/README.md Get the singleton Partner Service instance and create partner operations using your custom credentials implementation. ```java // Get singleton Partner Service PartnerService partnerService = PartnerService.getInstance(); // Create credentials (implement IPartnerCredentials interface) IPartnerCredentials credentials = createPartnerCredentials(); // Your implementation // Create partner operations IAggregatePartner partner = partnerService.createPartnerOperations(credentials); ``` -------------------------------- ### Complete Customer Creation Workflow Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/customers.md Demonstrates the full process of creating a new customer, including setting company and billing profiles, defining the partner relationship, and then retrieving the created customer. Requires initialization of PartnerService and obtaining an IAggregatePartner instance. ```java PartnerService partnerService = PartnerService.getInstance(); IAggregatePartner partner = partnerService.createPartnerOperations(credentials); Customer newCustomer = new Customer(); CustomerCompanyProfile companyProfile = new CustomerCompanyProfile(); companyProfile.setCompanyName("Acme Corp"); companyProfile.setEmail("contact@acme.com"); companyProfile.setPhoneNumber("555-1234"); Address address = new Address(); address.setAddressLine1("123 Main Street"); address.setCity("Seattle"); address.setStateOrProvince("WA"); address.setCountry("US"); address.setPostalCode("98101"); companyProfile.setAddress(address); newCustomer.setCompanyProfile(companyProfile); CustomerBillingProfile billingProfile = new CustomerBillingProfile(); billingProfile.setFirstName("John"); billingProfile.setLastName("Doe"); billingProfile.setEmail("billing@acme.com"); billingProfile.setPhoneNumber("555-5678"); billingProfile.setAddress(address); newCustomer.setBillingProfile(billingProfile); newCustomer.setRelationshipToPartner(CustomerPartnerRelationship.RESELLER); newCustomer.setAllowDelegatedAccess(true); Customer createdCustomer = partner.getCustomers().create(newCustomer); System.out.println("Created customer with ID: " + createdCustomer.getId()); ICustomer customerOps = partner.getCustomers().byId(createdCustomer.getId()); Customer retrieved = customerOps.get(); IOrderCollection orders = customerOps.getOrders(); ISubscriptionCollection subscriptions = customerOps.getSubscriptions(); ``` -------------------------------- ### Get Locale from IRequestContext Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/request-context-and-utilities.md Retrieves the locale or language code for the request, which influences response language and formatting. Examples include "en-US" or "fr-FR". ```java String getLocale() ``` ```java String locale = context.getLocale(); System.out.println("Locale: " + locale); ``` -------------------------------- ### Get Conversions Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/orders-and-subscriptions.md Retrieves available conversion options (upgrades or downgrades) for a subscription. ```APIDOC ## Get Conversions ### Description Gets available conversions (upgrades/downgrades) for the subscription. ### Method ```java ISubscriptionConversionCollection getConversions() ``` ### Returns `ISubscriptionConversionCollection` - Conversion operations ``` -------------------------------- ### Get Customer Offers Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/customers.md Retrieves operations for accessing offers available for the customer. ```java ICustomerOfferCollection offers = partnerOperations.getCustomers().byId("customer-id-123").getOffers(); ``` -------------------------------- ### Get Customer Configuration Policies Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/customers.md Retrieves operations for accessing device configuration policies for the customer. ```java IConfigurationPolicyCollection configurationPolicies = partnerOperations.getCustomers().byId("customer-id-123").getConfigurationPolicies(); ``` -------------------------------- ### Discover Products, SKUs, Offer Categories, and Offers Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/products-and-offers.md This snippet demonstrates how to retrieve products, their associated SKUs, offer categories, and specific offers by country and category using the Partner Center Java SDK. It includes fetching lists and individual offer details. ```java PartnerService partnerService = PartnerService.getInstance(); IAggregatePartner partner = partnerService.createPartnerOperations(credentials); String country = "US"; // Get products System.out.println("=== PRODUCTS ==="); IProductCollectionByCountry productsByCountry = partner.getProducts().byCountry(country); ResourceCollection products = productsByCountry.get(0, 50); for (Product product : products.getItems()) { System.out.println("ID: " + product.getId()); System.out.println("Title: " + product.getTitle()); // Get SKUs for this product IProduct productOps = productsByCountry.byId(product.getId()); ResourceCollection skus = productOps.getSkus().get(); System.out.println("SKUs: " + skus.getItems().size()); } // Get offer categories System.out.println("\n=== OFFER CATEGORIES ==="); ResourceCollection categories = partner.getOfferCategories().byCountry(country).get(); for (OfferCategory category : categories.getItems()) { System.out.println("Category: " + category.getId() + " - " + category.getName()); } // Get offers by category System.out.println("\n=== OFFERS ==="); String categoryId = "software"; // Example category ResourceCollection offers = partner.getOffers().byCountry(country).byCategory(categoryId).get(); for (Offer offer : offers.getItems()) { System.out.println("Offer ID: " + offer.getId()); System.out.println("Name: " + offer.getName()); System.out.println("Product: " + offer.getProductId()); System.out.println("Price: " + offer.getUnitPrice() + " " + offer.getCurrencyCode()); System.out.println("Minimum Qty: " + offer.getMinimumQuantity()); System.out.println("---"); } // Get specific offer details System.out.println("\n=== SPECIFIC OFFER ==="); Offer specificOffer = partner.getOffers().byCountry(country) .byId("MS-AZR-0145P").get(); System.out.println("Name: " + specificOffer.getName()); System.out.println("Description: " + specificOffer.getDescription()); System.out.println("Unit Type: " + specificOffer.getUnitType()); System.out.println("Billing Type: " + specificOffer.getBillingType()); System.out.println("Is Add-On: " + specificOffer.getIsAddOn()); if (specificOffer.getPrerequisiteOffers() != null && !specificOffer.getPrerequisiteOffers().isEmpty()) { System.out.println("Prerequisites: " + specificOffer.getPrerequisiteOffers()); } ``` -------------------------------- ### Get Single Customer Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/customers.md Gets operations for a specific customer by ID. ```APIDOC ## Get Single Customer ### Description Gets operations for a specific customer by ID. ### Method GET ### Endpoint /customers/{customerId} ### Parameters #### Path Parameters - **customerId** (string) - Required - The customer identifier ### Response #### Success Response (200) - **id** (string) - The customer identifier - **companyProfile** (object) - Company profile information - **companyName** (string) - The name of the company ### Response Example ```json { "id": "customer-id-123", "companyProfile": { "companyName": "Contoso Inc." } } ``` ``` -------------------------------- ### Get Offers by Category Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/products-and-offers.md Gets offers filtered by a specific category using its identifier. ```APIDOC ## Get Offers by Category ### Description Gets offers filtered by category. ### Method ```java ICategoryOffersCollection byCategory(String categoryId) ``` ### Parameters #### Query Parameters - **categoryId** (String) - Required - The offer category identifier ### Returns `ICategoryOffersCollection` - Category-scoped offer operations ### Example ```java ResourceCollection softwareOffers = partnerOperations.getOffers().byCountry("US") .byCategory("software").get(); ``` ``` -------------------------------- ### Querying Customers with Filters Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/README.md Demonstrates how to build a query with a specific page size and filter to retrieve a collection of customers. ```java IQuery query = QueryFactory.getInstance().buildSimpleQuery(); query.setPageSize(50); query.setFilter(QueryFactory.getInstance().buildSimpleFilter("status", "active")); ResourceCollection results = partner.getCustomers().query(query); ``` -------------------------------- ### IRequestContext - Get Locale Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/request-context-and-utilities.md Gets the locale/language for the request, affecting response language and formatting. ```APIDOC ## Get Locale ### Description Gets the locale/language for the request (affects response language and formatting). ### Method ```java String getLocale() ``` ### Returns `String` - The locale code (e.g., "en-US", "fr-FR") ### Example ```java String locale = context.getLocale(); System.out.println("Locale: " + locale); ``` ``` -------------------------------- ### Example: Access MPN Profile Data Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/profiles-and-invoices.md Demonstrates how to retrieve the MPN profile and access its details like MPN ID, company name, and attributes. ```java MpnProfile mpnProfile = profiles.getMpnProfile().get(); System.out.println("MPN ID: " + mpnProfile.getMpnId()); System.out.println("Company Name: " + mpnProfile.getCompanyName()); System.out.println("Attributes: " + mpnProfile.getAttributes()); ``` -------------------------------- ### Get Single Offer by ID Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/products-and-offers.md Gets operations for a specific offer using its unique identifier. ```APIDOC ## Get Single Offer by ID ### Description Gets operations for a specific offer. ### Method ```java IOffer byId(String offerId) ``` ### Parameters #### Path Parameters - **offerId** (String) - Required - The offer identifier ### Returns `IOffer` - Offer-specific operations ### Example ```java IOffer offer = partnerOperations.getOffers().byCountry("US") .byId("MS-AZR-0145P"); Offer details = offer.get(); ``` ``` -------------------------------- ### Customer Creation Workflow Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/customers.md Demonstrates a complete workflow for creating a new customer, including setting up their company profile, billing information, and partner relationship. It also shows how to retrieve the created customer and access related operations. ```APIDOC ## Customer Creation Workflow ### Description This example illustrates the process of creating a new customer using the Partner Center Java SDK. It covers initializing the SDK, defining customer details such as company profile and billing profile, setting the partner relationship, and finally creating and retrieving the customer. ### Method This is a client-side SDK example, not a direct HTTP API call. The `create` method on `ICustomerCollection` is invoked. ### Endpoint N/A (SDK method) ### Parameters This example uses the following data structures: - `Customer`: Represents the customer entity. - `CustomerCompanyProfile`: Contains company legal name, address, email, phone, and website. - `Address`: Contains address details like street, city, state, country, and postal code. - `CustomerBillingProfile`: Contains billing contact information (first name, last name, email, phone) and billing address. - `CustomerPartnerRelationship`: Defines the relationship type between the partner and the customer (e.g., RESELLER, END_USER, NONE). ### Request Example ```java // Initialize PartnerService PartnerService partnerService = PartnerService.getInstance(); IAggregatePartner partner = partnerService.createPartnerOperations(credentials); // Create a new customer object Customer newCustomer = new Customer(); // Set company profile CustomerCompanyProfile companyProfile = new CustomerCompanyProfile(); companyProfile.setCompanyName("Acme Corp"); companyProfile.setEmail("contact@acme.com"); companyProfile.setPhoneNumber("555-1234"); Address address = new Address(); address.setAddressLine1("123 Main Street"); address.setCity("Seattle"); address.setStateOrProvince("WA"); address.setCountry("US"); address.setPostalCode("98101"); companyProfile.setAddress(address); newCustomer.setCompanyProfile(companyProfile); // Set billing profile CustomerBillingProfile billingProfile = new CustomerBillingProfile(); billingProfile.setFirstName("John"); billingProfile.setLastName("Doe"); billingProfile.setEmail("billing@acme.com"); billingProfile.setPhoneNumber("555-5678"); billingProfile.setAddress(address); newCustomer.setBillingProfile(billingProfile); // Set relationship and delegation newCustomer.setRelationshipToPartner(CustomerPartnerRelationship.RESELLER); newCustomer.setAllowDelegatedAccess(true); // Create the customer Customer createdCustomer = partner.getCustomers().create(newCustomer); System.out.println("Created customer with ID: " + createdCustomer.getId()); // Retrieve the customer ICustomer customerOps = partner.getCustomers().byId(createdCustomer.getId()); Customer retrieved = customerOps.get(); // Access related operations IOrderCollection orders = customerOps.getOrders(); ISubscriptionCollection subscriptions = customerOps.getSubscriptions(); ``` ### Response #### Success Response Upon successful creation, the `create` method returns a `Customer` object representing the newly created customer, including their unique ID. #### Response Example ```json { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "companyProfile": { "companyName": "Acme Corp", "address": { "addressLine1": "123 Main Street", "city": "Seattle", "stateOrProvince": "WA", "country": "US", "postalCode": "98101" }, "email": "contact@acme.com", "phoneNumber": "555-1234", "websiteUrl": null, "companyApprovalAddress": null, "companyApprovalEmail": null }, "billingProfile": { "firstName": "John", "lastName": "Doe", "email": "billing@acme.com", "phoneNumber": "555-5678", "address": { "addressLine1": "123 Main Street", "city": "Seattle", "stateOrProvince": "WA", "country": "US", "postalCode": "98101" } }, "relationshipToPartner": "RESELLER", "allowDelegatedAccess": true } ``` ``` -------------------------------- ### IRequestContext - Get Request ID Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/request-context-and-utilities.md Gets the unique identifier for a single Partner Center API call. ```APIDOC ## Get Request ID ### Description Gets the request identifier that uniquely identifies a single Partner Center API call. ### Method ```java UUID getRequestId() ``` ### Returns `UUID` - The unique request identifier ### Note Auto-generated for each API call if not explicitly set ### Example ```java IRequestContext context = partnerOperations.getRequestContext(); UUID requestId = context.getRequestId(); System.out.println("Request ID: " + requestId); ``` ``` -------------------------------- ### Configure HTTP Proxy for Partner Center SDK Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/README.md Set up proxy options for the Partner Center SDK when operating in environments that require an HTTP proxy. This ensures network requests are routed correctly. ```java PartnerService service = PartnerService.getInstance(); service.setProxyOptions("proxy.company.com", 8080); ``` -------------------------------- ### Basic PartnerException Handling in Java Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/errors.md Demonstrates a basic try-catch block to catch PartnerException and print its message and error category. It also shows how to access the service error payload if available. ```java try { IAggregatePartner partner = partnerService.createPartnerOperations(credentials); Customer customer = partner.getCustomers().byId("invalid-id").get(); } catch (PartnerException ex) { System.err.println("Error: " + ex.getMessage()); System.err.println("Category: " + ex.getErrorCategory()); if (ex.getServiceErrorPayload() != null) { System.err.println("Service Error Code: " + ex.getServiceErrorPayload().getErrorCode()); } } ``` -------------------------------- ### Get Estimate Operations Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/profiles-and-invoices.md Gets operations for invoice estimates, which represent projected charges. This is part of the IEstimateCollection interface. ```java IEstimateCollection getEstimates() ``` -------------------------------- ### Get SDK Version Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/configuration.md Retrieves the version number of the Partner Center Java SDK. ```java PartnerService service = PartnerService.getInstance(); String version = service.getSdkVersion(); // Example: "1.15.4" ``` -------------------------------- ### Clone Partner Center Java SDK Repository Source: https://github.com/microsoft/partner-center-java/blob/master/README.md Use this bash command to clone the SDK's source code repository. Navigate into the cloned directory afterwards. ```bash git clone https://github.com/microsoft/partner-center-java.git cd Partner-Center-Java ``` -------------------------------- ### Get Usage Records Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/orders-and-subscriptions.md Gets monthly usage records for subscriptions. This provides insights into the consumption of services associated with subscriptions. ```APIDOC ## Get Usage Records ### Description Gets monthly usage records for subscriptions. ### Method GET ### Endpoint /customers/{customerId}/subscriptions/usage-records ### Parameters #### Path Parameters - **customerId** (string) - Required - The ID of the customer. ### Response #### Success Response (200) - **value** (array) - A collection of SubscriptionMonthlyUsageRecord objects. ### Response Example ```json { "value": [ { "subscriptionId": "subscription-id-1", "usage": 100, "billingCycle": "Monthly" } ] } ``` ``` -------------------------------- ### Get Available Subscription Conversions Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/orders-and-subscriptions.md Retrieves the collection of available conversions (upgrades or downgrades) for a given subscription. ```java ISubscriptionConversionCollection conversions = partnerOperations.getCustomers().byId("customer-id") .getSubscriptions().byId("sub-id").getConversions(); ``` -------------------------------- ### Get Deployment Percentage (LicenseUsageInsight) Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/analytics-and-rate-cards.md Retrieves the deployment percentage for a product from the LicenseUsageInsight model. This value ranges from 0 to 100. ```java public double getDeploymentPercent() public void setDeploymentPercent(double value) ``` -------------------------------- ### Get Single Subscription Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/orders-and-subscriptions.md Gets operations for a specific subscription by its ID. This allows for detailed retrieval and management of a single subscription. ```APIDOC ## Get Single Subscription ### Description Gets operations for a specific subscription using its unique identifier. ### Method GET ### Endpoint /customers/{customerId}/subscriptions/{subscriptionId} ### Parameters #### Path Parameters - **customerId** (string) - Required - The ID of the customer. - **subscriptionId** (string) - Required - The identifier of the subscription. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the subscription. - **status** (string) - The current status of the subscription. ### Response Example ```json { "id": "subscription-id-1", "status": "Active" } ``` ``` -------------------------------- ### Get Single Order Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/orders-and-subscriptions.md Gets operations for a specific order by its ID. This allows detailed retrieval and management of a single order. ```APIDOC ## Get Single Order ### Description Gets operations for a specific order. ### Method GET ### Endpoint /customers/{customerId}/orders/{orderId} ### Parameters #### Path Parameters - **orderId** (String) - Required - The order identifier ### Returns IOrder - Order-specific operations ### Request Example ```java IOrder order = partnerOperations.getCustomers().byId("customer-id") .getOrders().byId("order-id-123"); Order details = order.get(); ``` ``` -------------------------------- ### Create Customer Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/customers.md Creates a new customer account. ```APIDOC ## Create Customer ### Description Creates a new customer account. ### Method POST ### Endpoint /customers ### Parameters #### Request Body - **companyProfile** (object) - Required - Company profile information for the new customer - **companyName** (string) - Required - The name of the company - **address** (object) - Required - The company address - **addressLine1** (string) - Required - First line of the address - **city** (string) - Required - City - **stateOrProvince** (string) - Required - State or province - **postalCode** (string) - Required - Postal code - **country** (string) - Required - Country code (ISO 3166-1 alpha-2) ### Request Example ```json { "companyProfile": { "companyName": "Contoso Inc.", "address": { "addressLine1": "123 Main St", "city": "Bellevue", "stateOrProvince": "WA", "postalCode": "98004", "country": "US" } } } ``` ### Response #### Success Response (201) - **id** (string) - The unique identifier of the created customer - **companyProfile** (object) - Company profile information of the created customer ### Response Example ```json { "id": "new-customer-id-456", "companyProfile": { "companyName": "Contoso Inc.", "address": { "addressLine1": "123 Main St", "city": "Bellevue", "stateOrProvince": "WA", "postalCode": "98004", "country": "US" } } } ``` ``` -------------------------------- ### Complete Profile and Invoice Workflow Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/profiles-and-invoices.md This snippet demonstrates a comprehensive workflow for retrieving and updating partner profiles, as well as fetching and processing invoice data. It covers getting all profiles, specific profile types (organization, MPN, legal, billing), updating the billing profile, retrieving all invoices, invoice summaries, specific invoices, and invoice line items. ```java PartnerService partnerService = PartnerService.getInstance(); IAggregatePartner partner = partnerService.createPartnerOperations(credentials); // Get all profiles IPartnerProfileCollection profiles = partner.getProfiles(); // Get organization profile OrganizationProfile orgProfile = profiles.getOrganizationProfile().get(); System.out.println("Partner Company: " + orgProfile.getCompanyName()); System.out.println("Phone: " + orgProfile.getPhoneNumber()); System.out.println("Address: " + orgProfile.getAddress().getAddressLine1()); // Get MPN profile MpnProfile mpnProfile = profiles.getMpnProfile().get(); System.out.println("MPN ID: " + mpnProfile.getMpnId()); // Get legal profile LegalBusinessProfile legalProfile = profiles.getLegalBusinessProfile().get(); System.out.println("Legal Company Name: " + legalProfile.getCompanyName()); // Update billing profile IBillingProfile billingOps = profiles.getBillingProfile(); BillingProfile billingProfile = billingOps.get(); billingProfile.getAddress().setAddressLine1("456 New Street"); BillingProfile updated = billingOps.patch(billingProfile); // Get invoices IInvoiceCollection invoices = partner.getInvoices(); // Get all invoices ResourceCollection allInvoices = invoices.get(); System.out.println("Total invoices: " + allInvoices.getItems().size()); for (Invoice invoice : allInvoices.getItems()) { System.out.println("Invoice: " + invoice.getId()); System.out.println("Date: " + invoice.getInvoiceDate()); System.out.println("Amount: " + invoice.getInvoiceAmount() + " " + invoice.getCurrencyCode()); } // Get invoice summary (current balance) InvoiceSummary summary = invoices.getSummary().get(); System.out.println("Account Balance: " + summary.getAccountBalance()); System.out.println("Currency: " + summary.getCurrencyCode()); // Get a specific invoice Invoice specificInvoice = invoices.byId("invoice-id-123").get(); System.out.println("Due Date: " + specificInvoice.getDueDate()); // Get line items in invoice ResourceCollection lineItems = invoices.byId("invoice-id-123").getLineItems(); for (InvoiceLineItem item : lineItems.getItems()) { System.out.println("Item: " + item.getDescription()); System.out.println("Amount: " + item.getAmount()); } ``` -------------------------------- ### Get Invoice Summaries Operations Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/profiles-and-invoices.md Gets operations for all invoice summaries, providing one summary per billing period. ```java IInvoiceSummaryCollection getSummaries() ``` -------------------------------- ### AzureRateCard Offer Terms Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/analytics-and-rate-cards.md Gets or sets the applicable offer terms and conditions for the rate card. ```Java public List getOfferTerms() public void setOfferTerms(List value) ``` -------------------------------- ### Get Invoice Summary Operations Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/profiles-and-invoices.md Gets operations for the current account balance summary, representing the most recent invoice summary. ```java IInvoiceSummary getSummary() ``` -------------------------------- ### IRequestContext - Get Correlation ID Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/request-context-and-utilities.md Gets the correlation identifier used to group logical operations across multiple API calls. ```APIDOC ## Get Correlation ID ### Description Gets the correlation identifier used to group logical operations together across multiple API calls. ### Method ```java UUID getCorrelationId() ``` ### Returns `UUID` - The correlation identifier ### Example ```java UUID correlationId = context.getCorrelationId(); System.out.println("Correlation ID: " + correlationId); ``` ``` -------------------------------- ### Product Description Getter Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/products-and-offers.md Provides a way to retrieve the description of a product. ```java public String getDescription() { return null; } public void setDescription(String value) { } ``` -------------------------------- ### Get Single Invoice Operations Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/profiles-and-invoices.md Gets operations for a specific invoice identified by its ID. Use this to perform actions on a single invoice. ```java IInvoice byId(String invoiceId) ``` -------------------------------- ### Seek-based Pagination for Customers Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/README.md Shows how to implement seek-based pagination for customers. Use the continuation token to fetch the next set of results. ```java // Seek-based pagination SeekBasedResourceCollection customers = partner.getCustomers().get(); String nextToken = customers.getContinuationToken(); // Use nextToken to fetch next page ``` -------------------------------- ### Get License Deployment Insights Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/analytics-and-rate-cards.md Retrieves license deployment insights showing the distribution of licenses across customers. The results can be iterated to display product name, customer count, licenses sold, and licenses assigned. ```java ResourceCollection insights = partnerOperations.getAnalytics().getLicenses() .getDeploymentInsights().get(); for (LicenseDeploymentInsight insight : insights.getItems()) { System.out.println("Product: " + insight.getProductName()); System.out.println("Customers with Product: " + insight.getCustomerCount()); System.out.println("Licenses Sold: " + insight.getLicensesSold()); System.out.println("Licenses Assigned: " + insight.getLicensesAssigned()); } ``` -------------------------------- ### Retrieve All Customers Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/customers.md Retrieves all customers associated with the partner. Use this to get a collection of customers with pagination support. ```java ICustomerCollection customers = partnerOperations.getCustomers(); SeekBasedResourceCollection allCustomers = customers.get(); for (Customer customer : allCustomers.getItems()) { System.out.println("Customer: " + customer.getId() + " - " + customer.getCompanyProfile().getCompanyName()); } ``` -------------------------------- ### Get Product Details Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/products-and-offers.md Retrieves the details for a specific product. Use this when you need to access information like the product's title or description. ```java Product get() { // Retrieves the product details. return null; } ``` ```java Product product = partnerOperations.getProducts().byCountry("US") .byId("microsoft-365-business-standard").get(); System.out.println("Title: " + product.getTitle()); System.out.println("Description: " + product.getDescription()); ``` -------------------------------- ### Offset-based Pagination for Offers Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/README.md Illustrates how to retrieve paginated results for offers using an offset-based approach. Fetch subsequent pages by adjusting the offset. ```java // Offset-based pagination ResourceCollection page1 = partner.getOffers().byCountry("US").get(0, 100); ResourceCollection page2 = partner.getOffers().byCountry("US").get(100, 100); ``` -------------------------------- ### Get Single Offer by ID Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/products-and-offers.md Gets operations for a specific offer using its unique identifier. This is useful when you need to retrieve details for a known offer. ```java IOffer offer = partnerOperations.getOffers().byCountry("US") .byId("MS-AZR-0145P"); Offer details = offer.get(); ``` -------------------------------- ### Manage Orders and Subscriptions Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/README.md Retrieve customer orders, create new orders, fetch subscriptions, and update existing subscriptions by ID. Ensure subscription properties are configured before creation or update. ```java // Get customer orders ResourceCollection orders = partner.getCustomers().byId("customer-id").getOrders().get(); // Create order Order newOrder = new Order(); // ... configure order ... Order created = partner.getCustomers().byId("customer-id") .getOrders().create(newOrder); // Get subscriptions ResourceCollection subscriptions = partner.getCustomers().byId("customer-id").getSubscriptions().get(); // Update subscription Subscription sub = subscriptions.getItems().get(0); sub.setFriendlyName("Updated Name"); partner.getCustomers().byId("customer-id") .getSubscriptions().byId(sub.getId()).patch(sub); ``` -------------------------------- ### Get Single Offer Category by ID Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/products-and-offers.md Gets operations for a specific offer category identified by its ID. This method returns an IOfferCategory object that allows further interaction with the specific category. ```APIDOC ## Get Single Offer Category by ID ### Description Retrieves operations for a specific offer category using its unique identifier. ### Method ```java IOfferCategory byId(String categoryId) ``` ### Parameters #### Path Parameters - **categoryId** (String) - Required - The unique identifier of the category to retrieve. ### Returns `IOfferCategory` - An object representing the specific category and its operations. ### Example ```java // Assuming partnerOperations is an initialized PartnerOperations object // and "someCategoryId" is the ID of the category you want to access String categoryId = "someCategoryId"; IOfferCategory categoryOperations = partnerOperations.getOfferCategories().byCountry("US").byId(categoryId); // You can now use categoryOperations to perform actions related to this specific category // For example, if there were a method to get details: // OfferCategory details = categoryOperations.get(); ``` ``` -------------------------------- ### Analyze Partner License Usage and Deployment Insights Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/analytics-and-rate-cards.md Retrieves and prints license usage and deployment insights for a partner. This is useful for understanding product adoption and sales performance. ```java public class AnalyticsAndPricingExample { public void analyzePartnerMetrics(IAggregatePartner partner) { System.out.println("=== PARTNER ANALYTICS ==="); IPartnerAnalyticsCollection analytics = partner.getAnalytics(); IPartnerLicensesAnalyticsCollection licenses = analytics.getLicenses(); // Usage insights ResourceCollection usageInsights = licenses.getUsageInsights().get(); System.out.println("\nLicense Usage:"); for (LicenseUsageInsight insight : usageInsights.getItems()) { System.out.println(" Product: " + insight.getProductName()); System.out.println(" Active Users: " + insight.getActiveUsers()); System.out.println(" Deployment %: " + insight.getDeploymentPercent()); } // Deployment insights ResourceCollection deploymentInsights = licenses.getDeploymentInsights().get(); System.out.println("\nLicense Deployment:"); for (LicenseDeploymentInsight insight : deploymentInsights.getItems()) { System.out.println(" Product: " + insight.getProductName()); System.out.println(" Customers: " + insight.getCustomerCount()); System.out.println(" Licenses Sold: " + insight.getLicensesSold()); System.out.println(" Licenses Assigned: " + insight.getLicensesAssigned()); } } ``` -------------------------------- ### Partner Service and Operations Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/INDEX.md Documentation for PartnerService (singleton factory, configuration, proxy settings), PartnerOperations (main operations implementation), AggregatePartnerOperations (scoped operations), BasePartnerComponent (base class for operations), AuthenticationToken (token handling and expiration), and IPartnerCredentials (authentication interface). ```APIDOC ## Partner Service and Operations ### Description Provides access to core Partner Center functionalities through a singleton factory and operations implementation. ### Key Components - **PartnerService**: Singleton factory for obtaining service clients and configuring the SDK. - **PartnerOperations**: Main class for implementing various Partner Center operations. - **AggregatePartnerOperations**: Provides scoped operations for specific contexts. - **BasePartnerComponent**: Base class for all operation components. - **AuthenticationToken**: Handles authentication token management and expiration. - **IPartnerCredentials**: Interface for managing partner authentication credentials. ``` -------------------------------- ### getEnumerators Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/partner-service-and-operations.md Gets collection enumerators for paginated results. ```APIDOC ## getEnumerators ### Description Gets collection enumerators for paginated results. ### Method N/A (Java method) ### Returns `IResourceCollectionEnumeratorContainer` - The enumerator container ``` -------------------------------- ### getRequestContext Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/partner-service-and-operations.md Gets the request context for this operations instance. ```APIDOC ## getRequestContext ### Description Gets the request context for this operations instance. ### Method N/A (Java method) ### Returns `IRequestContext` - The request context ``` -------------------------------- ### Retrieve Subscription Source: https://github.com/microsoft/partner-center-java/blob/master/_autodocs/api-reference/orders-and-subscriptions.md Gets the details of a specific customer subscription. ```APIDOC ## Retrieve Subscription ### Description Gets the subscription details. ### Method ```java Subscription get() ``` ### Returns `Subscription` - The subscription information ### Example ```java Subscription sub = partnerOperations.getCustomers().byId("customer-id") .getSubscriptions().byId("subscription-id").get(); ``` ```