Update docs-ref-services/partnercenter.md
This commit is contained in:
Родитель
5b82c473ee
Коммит
6940fc2fb6
|
@ -0,0 +1,68 @@
|
|||
---
|
||||
title: Partner Center Java SDK
|
||||
description: Reference documentation for the Partner Center Java SDK
|
||||
keywords: API, CSP, Cloud Soltuion Provider, Java, Partner Center, SDK
|
||||
author: iswillia
|
||||
ms.author: iswillia
|
||||
manager: lesliep
|
||||
ms.date: 10/09/2018
|
||||
ms.topic: reference
|
||||
ms.prod: partnercenter
|
||||
ms.technology: partnercenter
|
||||
ms.devlang: java
|
||||
---
|
||||
|
||||
# Partner Center libraries for Java
|
||||
|
||||
## Overview
|
||||
|
||||
The Partner Center libraries for Java is a SDK that provides the ability to interact with Microsoft's Partner Center service. This enables partners to perform the Partner Center operations programmatically. This is the latest addition to existing portfolio of REST APIs and the .NET SDK.
|
||||
|
||||
## Client library
|
||||
|
||||
Manage resources in Partner Center using the client library.
|
||||
|
||||
[Add a dependency](https://maven.apache.org/guides/getting-started/index.html#How_do_I_use_external_dependencies) to your Maven `pom.xml` file to use the client library in your project.
|
||||
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>com.microsoft.store</groupId>
|
||||
<artifactId>partnercenter</artifactId>
|
||||
<version>1.8.0</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
### Example
|
||||
|
||||
Retrieves a complete list of customer associated with the authenticated reseller.
|
||||
|
||||
```java
|
||||
IPartnerCredentials appCredentials = PartnerCredentials.getInstance().generateByApplicationCredentials('YOUR_APP_ID', 'YOUR_APP_SECRET', 'YOUR_TENANT_ID');
|
||||
IAggregatePartner partnerOperations = PartnerService.getInstance().createPartnerOperations(appCredentials);
|
||||
|
||||
// Query the customers
|
||||
SeekBasedResourceCollection<Customer> customersPage = partnerOperations.getCustomers().query(QueryFactory.getInstance().buildIndexedQuery(100));
|
||||
this.getContext().getConsoleHelper().stopProgress();
|
||||
|
||||
// Create a customer enumerator which will aid us in traversing the customer pages
|
||||
IResourceCollectionEnumerator<SeekBasedResourceCollection<Customer>> customersEnumerator =
|
||||
partnerOperations.getEnumerators().getCustomers().create( customersPage );
|
||||
|
||||
int pageNumber = 1;
|
||||
|
||||
while ( customersEnumerator.hasValue() )
|
||||
{
|
||||
/*
|
||||
* Perform some operation with the current page of customers using
|
||||
* customersEnumerator.getCurrent()
|
||||
*/
|
||||
|
||||
// Get the next page of customers
|
||||
customersEnumerator.next();
|
||||
}
|
||||
```
|
||||
|
||||
## Samples
|
||||
|
||||
[Supported scenarios](https://docs.microsoft.com/partner-center/develop/scenarios)
|
||||
[Sample console application](https://github.com/Microsoft/Partner-Center-Java-Samples)
|
Загрузка…
Ссылка в новой задаче